PRAGMA foreign_keys = ON;

PRAGMA writable_schema = 1;
DELETE FROM sqlite_master WHERE type IN ("table", "index", "trigger");
PRAGMA writable_schema = 0;
VACUUM;

CREATE TABLE "Documents" (
"Document_ID" INT,
"Document_Name" VARCHAR(255),
"Document_Description" VARCHAR(255),
PRIMARY KEY ("Document_ID")
);

CREATE TABLE "Ref_Template_Types" (
"Template_Type_Code" CHAR(15) UNIQUE,
"Template_Type_Description" VARCHAR(255),
PRIMARY KEY ("Template_Type_Code")
);

CREATE TABLE "Templates" (
"Template_ID" INT UNIQUE,
"Template_Type_Code" CHAR(15),
PRIMARY KEY ("Template_ID"),
FOREIGN KEY ("Template_Type_Code") REFERENCES "Ref_Template_Types"("Template_Type_Code")
);





INSERT INTO "Documents" VALUES ("1", "Meeting Minutes", "Official record of meeting discussions and decisions.");
INSERT INTO "Documents" VALUES ("2", "Project Proposal", "Detailed plan for a new project, including objectives and scope.");
INSERT INTO "Documents" VALUES ("3", "Expense Report", "Form for submitting and tracking business expenses.");
INSERT INTO "Documents" VALUES ("4", "Invoice", "Request for payment for goods or services provided.");
INSERT INTO "Documents" VALUES ("5", "Contract Agreement", "Legally binding document outlining terms and conditions.");
INSERT INTO "Documents" VALUES ("6", "Performance Review", "Evaluation of an employees work performance.");
INSERT INTO "Documents" VALUES ("7", "Marketing Plan", "Strategy for promoting products or services.");
INSERT INTO "Documents" VALUES ("8", "Research Paper", "Academic document presenting original research findings.");
INSERT INTO "Documents" VALUES ("9", "Press Release", "Official statement issued to the media.");
INSERT INTO "Documents" VALUES ("10", "Training Manual", "Guide for learning a new skill or system.");
INSERT INTO "Ref_Template_Types" VALUES ("FIN", "Financial Documents");
INSERT INTO "Ref_Template_Types" VALUES ("HR", "Human Resources Documents");
INSERT INTO "Ref_Template_Types" VALUES ("PROJ", "Project Management Documents");
INSERT INTO "Ref_Template_Types" VALUES ("MKT", "Marketing Documents");
INSERT INTO "Ref_Template_Types" VALUES ("LEGAL", "Legal Documents");
INSERT INTO "Ref_Template_Types" VALUES ("GEN", "General Office Documents");
INSERT INTO "Ref_Template_Types" VALUES ("ACAD", "Academic Documents");
INSERT INTO "Ref_Template_Types" VALUES ("PR", "Public Relations Documents");
INSERT INTO "Templates" VALUES ("101", "FIN");
INSERT INTO "Templates" VALUES ("102", "FIN");
INSERT INTO "Templates" VALUES ("103", "FIN");
INSERT INTO "Templates" VALUES ("201", "HR");
INSERT INTO "Templates" VALUES ("202", "HR");
INSERT INTO "Templates" VALUES ("301", "PROJ");
INSERT INTO "Templates" VALUES ("401", "MKT");
INSERT INTO "Templates" VALUES ("501", "LEGAL");
INSERT INTO "Templates" VALUES ("601", "GEN");
INSERT INTO "Templates" VALUES ("701", "ACAD");
INSERT INTO "Templates" VALUES ("801", "PR");
INSERT INTO "Templates" VALUES ("802", "PR");
INSERT INTO "Templates" VALUES ("901", "GEN");
INSERT INTO "Templates" VALUES ("902", "GEN");
INSERT INTO "Templates" VALUES ("903", "GEN");
INSERT INTO "Templates" VALUES ("904", "GEN");