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")
);

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")
);





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", "Research Paper Draft");
INSERT INTO "Documents" VALUES ("5", "104", "Company Policy Update");
INSERT INTO "Documents" VALUES ("6", "105", "Single Paragraph Doc");
INSERT INTO "Documents" VALUES ("7", "106", "Empty Document");
INSERT INTO "Documents" VALUES ("8", "101", "Meeting Minutes 2023-01-29");
INSERT INTO "Paragraphs" VALUES ("1", "1", "Attendees: John Doe, Jane Smith, Bob Johnson.");
INSERT INTO "Paragraphs" VALUES ("2", "1", "Discussion: Q1 performance review, new project initiatives.");
INSERT INTO "Paragraphs" VALUES ("3", "1", "Action Items: Follow up on Q1 report, schedule next meeting.");
INSERT INTO "Paragraphs" VALUES ("4", "2", "Introduction: This proposal outlines the Alpha project objectives.");
INSERT INTO "Paragraphs" VALUES ("5", "2", "Methodology: Agile development will be employed.");
INSERT INTO "Paragraphs" VALUES ("6", "2", "Timeline: Project completion expected by Q3.");
INSERT INTO "Paragraphs" VALUES ("7", "3", "Attendees: John Doe, Jane Smith.");
INSERT INTO "Paragraphs" VALUES ("8", "4", "Abstract: This paper explores the impact of AI on modern society.");
INSERT INTO "Paragraphs" VALUES ("9", "5", "Policy Update: Section 3.1 regarding remote work has been revised.");
INSERT INTO "Paragraphs" VALUES ("10", "6", "This document contains only one paragraph.");
INSERT INTO "Paragraphs" VALUES ("11", "8", "Attendees: Alice, Bob, Charlie.");
INSERT INTO "Paragraphs" VALUES ("12", "8", "Discussion: Budget allocation for Q2.");