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 ("AD1", "Advanced Advertisement Template");
INSERT INTO "Ref_Template_Types" VALUES ("AD2", "NULL");
INSERT INTO "Ref_Template_Types" VALUES ("BD", "Billing Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("CD", "Contract Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("ED", "Employee Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("FD", "Financial Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("GD", "General Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("HD", "Human Resources Document Template");
INSERT INTO "Ref_Template_Types" VALUES ("ID", "Invoice Document Template");
INSERT INTO "Templates" VALUES ("1", "2023-01-01 00:00:00", "Standard advertisement template for Q1");
INSERT INTO "Templates" VALUES ("2", "2023-06-15 00:00:00", "Updated billing template with new tax rules");
INSERT INTO "Templates" VALUES ("3", "2022-12-01 00:00:00", "Contract template for new hires");
INSERT INTO "Templates" VALUES ("4", "2023-03-20 00:00:00", "Employee onboarding document template");
INSERT INTO "Templates" VALUES ("5", "2023-05-10 00:00:00", "Financial report template for FY2022");
INSERT INTO "Templates" VALUES ("6", "2023-07-01 00:00:00", "General memo template");
INSERT INTO "Templates" VALUES ("7", "2023-02-28 00:00:00", "Advertisement template with seasonal offers");
INSERT INTO "Templates" VALUES ("8", "2023-04-15 00:00:00", "Invoice template with updated payment terms");