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),
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,
"Version_Number" INT,
"Template_Details" VARCHAR(255),
PRIMARY KEY ("Template_ID")
);





INSERT INTO "Documents" VALUES ("1", "Employee Handbook");
INSERT INTO "Documents" VALUES ("2", "Safety Guidelines");
INSERT INTO "Documents" VALUES ("3", "Project Plan");
INSERT INTO "Documents" VALUES ("4", "Marketing Strategy");
INSERT INTO "Documents" VALUES ("5", "Annual Report");
INSERT INTO "Ref_Template_Types" VALUES ("HR_POL", "Human Resources Policy");
INSERT INTO "Ref_Template_Types" VALUES ("SAF_GD", "Safety Guidelines");
INSERT INTO "Ref_Template_Types" VALUES ("PRJ_PLN", "Project Planning");
INSERT INTO "Ref_Template_Types" VALUES ("MKT_STR", "Marketing Strategy");
INSERT INTO "Ref_Template_Types" VALUES ("FIN_RPT", "Financial Report");
INSERT INTO "Ref_Template_Types" VALUES ("HR_POL_ADV", "Advanced HR Policy");
INSERT INTO "Ref_Template_Types" VALUES ("SAF_GD_INT", "Internal Safety Guidelines");
INSERT INTO "Templates" VALUES ("101", "1", "Basic HR Policy Template");
INSERT INTO "Templates" VALUES ("102", "2", "Updated Safety Guidelines Template");
INSERT INTO "Templates" VALUES ("103", "1", "Project Plan Template v1");
INSERT INTO "Templates" VALUES ("104", "3", "Marketing Strategy Template v3");
INSERT INTO "Templates" VALUES ("105", "1", "Annual Financial Report Template");
INSERT INTO "Templates" VALUES ("106", "2", "Advanced HR Policy Template");
INSERT INTO "Templates" VALUES ("107", "1", "Internal Safety Guidelines Template");