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", "Project Proposal", "Detailed plan for a new software project.");
INSERT INTO "Documents" VALUES ("2", "Meeting Minutes", "Summary of discussions and decisions from a team meeting.");
INSERT INTO "Documents" VALUES ("3", "Expense Report", "Record of business expenses for reimbursement.");
INSERT INTO "Documents" VALUES ("4", "User Manual", "Instructions for using a software application.");
INSERT INTO "Documents" VALUES ("5", "Bug Report", "Description of a software defect.");
INSERT INTO "Documents" VALUES ("6", "Invoice", "Request for payment for goods or services.");
INSERT INTO "Documents" VALUES ("7", "Contract Agreement", "Legal document outlining terms and conditions.");
INSERT INTO "Documents" VALUES ("8", "Performance Review", "Evaluation of an employees work performance.");
INSERT INTO "Documents" VALUES ("9", "Marketing Plan", "Strategy for promoting a product or service.");
INSERT INTO "Documents" VALUES ("10", "Technical Specification", "Detailed technical requirements for a system.");
INSERT INTO "Ref_Template_Types" VALUES ("PROPOSAL", "Project Proposal Template");
INSERT INTO "Ref_Template_Types" VALUES ("MEETING", "Meeting Minutes Template");
INSERT INTO "Ref_Template_Types" VALUES ("EXPENSE", "Expense Report Template");
INSERT INTO "Ref_Template_Types" VALUES ("MANUAL", "User Manual Template");
INSERT INTO "Ref_Template_Types" VALUES ("BUG", "Bug Report Template");
INSERT INTO "Ref_Template_Types" VALUES ("INVOICE", "Invoice Template");
INSERT INTO "Ref_Template_Types" VALUES ("CONTRACT", "Contract Agreement Template");
INSERT INTO "Ref_Template_Types" VALUES ("REVIEW", "Performance Review Template");
INSERT INTO "Ref_Template_Types" VALUES ("MARKETING", "Marketing Plan Template");
INSERT INTO "Ref_Template_Types" VALUES ("TECHSPEC", "Technical Specification Template");
INSERT INTO "Ref_Template_Types" VALUES ("REPORT", "General Report Template");
INSERT INTO "Ref_Template_Types" VALUES ("FORM", "General Form Template");
INSERT INTO "Ref_Template_Types" VALUES ("MEMO", "Internal Memo Template");
INSERT INTO "Templates" VALUES ("101", "PROPOSAL");
INSERT INTO "Templates" VALUES ("102", "PROPOSAL");
INSERT INTO "Templates" VALUES ("103", "PROPOSAL");
INSERT INTO "Templates" VALUES ("201", "MEETING");
INSERT INTO "Templates" VALUES ("202", "MEETING");
INSERT INTO "Templates" VALUES ("301", "EXPENSE");
INSERT INTO "Templates" VALUES ("401", "MANUAL");
INSERT INTO "Templates" VALUES ("501", "BUG");
INSERT INTO "Templates" VALUES ("502", "BUG");
INSERT INTO "Templates" VALUES ("601", "INVOICE");
INSERT INTO "Templates" VALUES ("701", "CONTRACT");
INSERT INTO "Templates" VALUES ("801", "REVIEW");
INSERT INTO "Templates" VALUES ("901", "MARKETING");
INSERT INTO "Templates" VALUES ("1001", "TECHSPEC");
INSERT INTO "Templates" VALUES ("1101", "REPORT");
INSERT INTO "Templates" VALUES ("1102", "REPORT");
INSERT INTO "Templates" VALUES ("1103", "REPORT");
INSERT INTO "Templates" VALUES ("1104", "REPORT");
INSERT INTO "Templates" VALUES ("1201", "FORM");
INSERT INTO "Templates" VALUES ("1301", "MEMO");