api/migrations/2023-12-30-192105_tracks/up.sql

17 lines
387 B
MySQL
Raw Normal View History

2023-12-31 00:21:07 +00:00
-- Your SQL goes here
CREATE TABLE IF NOT EXISTS tracks
(
id VARCHAR(24) DEFAULT nanoid(24),
title VARCHAR(255) NOT NULL,
duration_ms INT NOT NULL DEFAULT 0,
created_at TIMESTAMP DEFAULT now() NOT NULL,
updated_at TIMESTAMP,
-- music services
spotify_id VARCHAR(21) UNIQUE,
tidal_id VARCHAR(10) UNIQUE,
PRIMARY KEY (id)
);