feat: create a model for subtasks
This commit is contained in:
4
migrations/2024-09-08-083610_create_subtasks/down.sql
Normal file
4
migrations/2024-09-08-083610_create_subtasks/down.sql
Normal file
@ -0,0 +1,4 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS "subtasks";
|
15
migrations/2024-09-08-083610_create_subtasks/up.sql
Normal file
15
migrations/2024-09-08-083610_create_subtasks/up.sql
Normal 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');
|
||||
|
Reference in New Issue
Block a user