api/migrations/2023-12-31-104738_artists/up.sql

17 lines
424 B
MySQL
Raw Permalink Normal View History

2024-01-01 02:18:33 +00:00
-- Your SQL goes here
create table if not exists artists
(
id varchar(24) default nanoid(24),
name varchar(255) NOT NULL,
2024-01-01 22:58:26 +00:00
slug varchar unique not null generated always as (lower(replace(name, ' ', '-'))) stored,
2024-01-01 02:18:33 +00:00
2024-01-01 22:58:26 +00:00
created_at timestamp default now(),
updated_at timestamp,
2024-01-01 02:18:33 +00:00
-- music services
2024-01-01 22:58:26 +00:00
spotify_id varchar(22) unique,
tidal_id varchar(10) unique,
2024-01-01 02:18:33 +00:00
primary key (id)
);