diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql new file mode 100644 index 0000000..435de88 --- /dev/null +++ b/src/main/resources/data.sql @@ -0,0 +1,20 @@ +INSERT INTO "projects" (name, description) +VALUES ('Alpha Project', 'Primary project for creating new project'); +INSERT INTO "projects" (name, description) +VALUES ('Beta Project', 'Description of the secondary project'); + +INSERT INTO "tasks" (projectId, title, priority, dueDate, description) +VALUES (1, 'Create Alpha repo', 1, DATE '2024-10-01', 'Complete the first task'); +INSERT INTO "tasks" (projectId, title, priority, dueDate, description) +VALUES (1, 'Add branch rules', 2, DATE '2024-10-10', 'Complete the second task'); +INSERT INTO "tasks" (projectId, title, priority, dueDate, description) +VALUES (2, 'Create repo for Beta', 3, DATE '2024-10-05', 'Task for Project Beta'); + +INSERT INTO "labels" (taskId, title, description) +VALUES (1, 'Urgent', 'Needs to be done ASAP'); +INSERT INTO "labels" (taskId, title, description) +VALUES (1, 'Research', 'Requires investigation'); +INSERT INTO "labels" (taskId, title, description) +VALUES (2, 'Review', 'Needs to be reviewed by the team'); +INSERT INTO "labels" (taskId, title, description) +VALUES (3, 'Follow-up', 'Requires follow-up after completion'); \ No newline at end of file diff --git a/src/main/resources/schema.sql b/src/main/resources/schema.sql new file mode 100644 index 0000000..68c6717 --- /dev/null +++ b/src/main/resources/schema.sql @@ -0,0 +1,26 @@ +CREATE TABLE "projects" +( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + description VARCHAR(255) +); + +CREATE TABLE "tasks" +( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + projectId BIGINT, + title VARCHAR(255) NOT NULL, + priority INT, + dueDate DATE, + description VARCHAR(255), + FOREIGN KEY (projectId) REFERENCES "projects" (id) +); + +CREATE TABLE "labels" +( + id BIGINT AUTO_INCREMENT PRIMARY KEY, + taskId BIGINT, + title VARCHAR(255) NOT NULL, + description VARCHAR(255), + FOREIGN KEY (taskId) REFERENCES "tasks" (id) +); \ No newline at end of file