summaryrefslogtreecommitdiffstats
path: root/migrations
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-05-07 12:37:30 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-05-07 12:37:44 -0500
commitc55c5b3ccf9f06775fb00a2bcb2912f218691758 (patch)
tree3535e4eda3f25a168b0af3997b0744214a5c67b9 /migrations
parent1dbe3776c682f469d1497247fac22f0aa233a598 (diff)
feat(api,wip): impl tasks CRUD endpoint
Diffstat (limited to 'migrations')
-rw-r--r--migrations/20240417203222_create_task.down.sql1
-rw-r--r--migrations/20240417203222_create_task.up.sql12
2 files changed, 13 insertions, 0 deletions
diff --git a/migrations/20240417203222_create_task.down.sql b/migrations/20240417203222_create_task.down.sql
new file mode 100644
index 0000000..36cf80d
--- /dev/null
+++ b/migrations/20240417203222_create_task.down.sql
@@ -0,0 +1 @@
+DROP TABLE task;
diff --git a/migrations/20240417203222_create_task.up.sql b/migrations/20240417203222_create_task.up.sql
new file mode 100644
index 0000000..fd8eb9c
--- /dev/null
+++ b/migrations/20240417203222_create_task.up.sql
@@ -0,0 +1,12 @@
+CREATE TABLE task (
+ id UUID NOT NULL PRIMARY KEY DEFAULT uuid_generate_v4(),
+ user_id UUID REFERENCES user_(id) ON DELETE SET NULL,
+ title TEXT NOT NULL,
+ description TEXT,
+ remote BOOLEAN NOT NULL,
+ location TEXT,
+ start_at TIMESTAMP WITH TIME ZONE,
+ end_at TIMESTAMP WITH TIME ZONE,
+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
+ updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
+);