initial commit

This commit is contained in:
Miguel da Mota 2023-12-31 01:21:07 +01:00
commit 8a19a733d6
35 changed files with 2489 additions and 0 deletions

View file

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

View file

@ -0,0 +1,16 @@
CREATE TABLE IF NOT EXISTS playlists
(
id VARCHAR(24) DEFAULT nanoid(24),
name VARCHAR(255) NOT NULL,
creator_id VARCHAR(24) NOT NULL,
created_at TIMESTAMP DEFAULT now() NOT NULL,
updated_at TIMESTAMP,
PRIMARY KEY (id),
FOREIGN KEY (creator_id)
REFERENCES users (id)
);
CREATE INDEX ON playlists (creator_id);