api/migrations/2023-12-30-162032_playlists/up.sql

17 lines
393 B
MySQL
Raw Normal View History

2023-12-31 00:21:07 +00:00
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);