Add todos table migration
This commit is contained in:
10
migrations/001_create_todos.sql
Normal file
10
migrations/001_create_todos.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
create table if not exists public.todos (
|
||||||
|
id bigserial primary key,
|
||||||
|
user_id uuid not null,
|
||||||
|
title text not null check (length(title) between 1 and 500),
|
||||||
|
completed boolean not null default false,
|
||||||
|
created_at timestamptz not null default now()
|
||||||
|
);
|
||||||
|
|
||||||
|
create index if not exists todos_user_id_created_at_idx
|
||||||
|
on public.todos (user_id, created_at desc);
|
||||||
Reference in New Issue
Block a user