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,
"Paragraph_Text" VARCHAR(255),
PRIMARY KEY ("Paragraph_ID")
);

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





INSERT INTO "Documents" VALUES ("1", "101", "Meeting Minutes 2023-01-15");
INSERT INTO "Documents" VALUES ("2", "102", "Project Proposal Alpha");
INSERT INTO "Documents" VALUES ("3", "101", "Meeting Minutes 2023-01-22");
INSERT INTO "Documents" VALUES ("4", "103", "Client Contract Draft v1");
INSERT INTO "Documents" VALUES ("5", "102", "Project Report Beta");
INSERT INTO "Documents" VALUES ("6", "101", "Meeting Minutes 2023-01-29");
INSERT INTO "Documents" VALUES ("7", "103", "Client Contract Final");
INSERT INTO "Documents" VALUES ("8", "105", "Internal Memo Q1");
INSERT INTO "Paragraphs" VALUES ("1", "This is the first paragraph of the document.");
INSERT INTO "Paragraphs" VALUES ("2", "The second paragraph contains important details.");
INSERT INTO "Paragraphs" VALUES ("3", "A concluding paragraph summarizes the content.");
INSERT INTO "Paragraphs" VALUES ("4", "Additional information can be found in the appendix.");
INSERT INTO "Paragraphs" VALUES ("5", "This paragraph is part of a different document.");
INSERT INTO "Paragraphs" VALUES ("6", "It provides context for the main topic.");
INSERT INTO "Paragraphs" VALUES ("7", "Further discussion will be held next week.");
INSERT INTO "Paragraphs" VALUES ("8", "Please review and provide your feedback.");
INSERT INTO "Templates" VALUES ("101", "Standard Meeting Minutes Template");
INSERT INTO "Templates" VALUES ("102", "Project Proposal Template v2.0");
INSERT INTO "Templates" VALUES ("103", "Legal Contract Template");
INSERT INTO "Templates" VALUES ("104", "Marketing Brochure Template");
INSERT INTO "Templates" VALUES ("105", "Internal Communication Memo Template");
INSERT INTO "Templates" VALUES ("106", "Research Paper Template");
INSERT INTO "Templates" VALUES ("107", "Invoice Template");