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 UNIQUE,
"Template_ID" INT,
"Document_Name" VARCHAR(255),
PRIMARY KEY ("Document_ID"),
FOREIGN KEY ("Template_ID") REFERENCES "Templates"("Template_ID")
);

CREATE TABLE "Paragraphs" (
"Paragraph_ID" INT,
"Document_ID" INT,
"Paragraph_Text" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID"),
FOREIGN KEY ("Document_ID") REFERENCES "Documents"("Document_ID")
);

CREATE TABLE "Templates" (
"Template_ID" INT,
"Template_Details" VARCHAR(255),
PRIMARY KEY ("Template_ID")
);





INSERT INTO "Templates" VALUES ("1", "Standard Letter Template");
INSERT INTO "Templates" VALUES ("2", "Report Template v1.0");
INSERT INTO "Templates" VALUES ("3", "Marketing Brochure Template");
INSERT INTO "Templates" VALUES ("4", "Meeting Minutes Template");
INSERT INTO "Templates" VALUES ("5", "Contract Template");
INSERT INTO "Documents" VALUES ("101", "1", "Summer Show");
INSERT INTO "Documents" VALUES ("102", "2", "Annual Report 2023");
INSERT INTO "Documents" VALUES ("103", "1", "Client Welcome Letter");
INSERT INTO "Documents" VALUES ("104", "3", "Product Launch Brochure");
INSERT INTO "Documents" VALUES ("105", "4", "Board Meeting Minutes");
INSERT INTO "Documents" VALUES ("106", "1", "Summer Show - Draft");
INSERT INTO "Documents" VALUES ("107", "5", "Service Agreement");
INSERT INTO "Documents" VALUES ("108", "2", "Quarterly Review");
INSERT INTO "Paragraphs" VALUES ("1", "101", "Welcome to the Summer Show!");
INSERT INTO "Paragraphs" VALUES ("2", "101", "This year features exciting new exhibits.");
INSERT INTO "Paragraphs" VALUES ("3", "101", "Enjoy your visit and explore all the attractions.");
INSERT INTO "Paragraphs" VALUES ("4", "102", "Introduction to the annual performance.");
INSERT INTO "Paragraphs" VALUES ("5", "102", "Financial highlights for the fiscal year.");
INSERT INTO "Paragraphs" VALUES ("6", "103", "Dear new client, we are thrilled to have you.");
INSERT INTO "Paragraphs" VALUES ("7", "103", "Here is some information to get you started.");
INSERT INTO "Paragraphs" VALUES ("8", "104", "Discover our revolutionary new product.");
INSERT INTO "Paragraphs" VALUES ("9", "104", "Key features and benefits.");
INSERT INTO "Paragraphs" VALUES ("10", "105", "Attendees: John, Jane, Bob.");
INSERT INTO "Paragraphs" VALUES ("11", "105", "Agenda items discussed.");
INSERT INTO "Paragraphs" VALUES ("12", "106", "Draft paragraph 1 for Summer Show.");
INSERT INTO "Paragraphs" VALUES ("13", "106", "Draft paragraph 2 for Summer Show.");
INSERT INTO "Paragraphs" VALUES ("14", "101", "Dont miss the live performances!");
INSERT INTO "Paragraphs" VALUES ("15", "107", "Terms and conditions apply.");
INSERT INTO "Paragraphs" VALUES ("16", "108", "Review of Q1 performance.");