This commit is contained in:
Miguel da Mota 2024-01-01 03:18:33 +01:00
parent 8a19a733d6
commit 52ef924f12
28 changed files with 577 additions and 170 deletions

View file

@ -1,2 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE playlists;
drop table playlists;

View file

@ -1,16 +1,16 @@
CREATE TABLE IF NOT EXISTS playlists
create table if not exists playlists
(
id VARCHAR(24) DEFAULT nanoid(24),
name VARCHAR(255) NOT NULL,
id varchar(24) default nanoid(24),
name varchar(255) not null,
public bool default false,
creator_id VARCHAR(24) NOT NULL,
creator_id varchar(24) not null,
created_at TIMESTAMP DEFAULT now() NOT NULL,
updated_at TIMESTAMP,
created_at timestamp default now() not null,
updated_at timestamp,
PRIMARY KEY (id),
FOREIGN KEY (creator_id)
REFERENCES users (id)
primary key (id),
foreign key (creator_id)
references users (id)
on delete cascade
);
CREATE INDEX ON playlists (creator_id);