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





INSERT INTO "Ref_Template_Types" VALUES ("AD", "Advertisement Template");
INSERT INTO "Ref_Template_Types" VALUES ("IN", "Invoice Template");
INSERT INTO "Ref_Template_Types" VALUES ("CN", "Contract Template");
INSERT INTO "Ref_Template_Types" VALUES ("RP", "Report Template");
INSERT INTO "Ref_Template_Types" VALUES ("MN", "Manual Template");
INSERT INTO "Templates" VALUES ("1", "2023-01-01 00:00:00", "Standard Advertisement Template Details");
INSERT INTO "Templates" VALUES ("2", "2023-06-15 00:00:00", "Invoice Template for Q2");
INSERT INTO "Templates" VALUES ("3", "2022-12-01 00:00:00", "Contract Template Version 3");
INSERT INTO "Templates" VALUES ("4", "2023-03-20 00:00:00", "Monthly Report Template");
INSERT INTO "Templates" VALUES ("5", "2023-05-10 00:00:00", "User Manual Template Updated");