feat: create a model for subtasks

This commit is contained in:
2024-09-08 19:51:52 +02:00
parent 1be1e8f65a
commit a5a67792d7
11 changed files with 314 additions and 2 deletions

View File

@ -0,0 +1,4 @@
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS "subtasks";

View File

@ -0,0 +1,15 @@
-- Your SQL goes here
CREATE TABLE "subtasks"(
"id" SERIAL NOT NULL PRIMARY KEY,
"task_id" INT4 NOT NULL,
"title" TEXT NOT NULL,
"is_completed" BOOL NOT NULL,
"created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY ("task_id") REFERENCES "tasks"("id") ON DELETE CASCADE
);
SELECT diesel_manage_updated_at('subtasks');