1
0
Fork 0
ncpn/migrations/20240416191149_create-link-file.up.sql

17 lines
373 B
MySQL
Raw Normal View History

2024-04-16 22:07:00 +02:00
CREATE TABLE IF NOT EXISTS link (
id UUID PRIMARY KEY,
slug TEXT UNIQUE NOT NULL,
destination TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS file (
id UUID PRIMARY KEY,
hash BYTEA UNIQUE NOT NULL,
mime TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS file_key (
id UUID PRIMARY KEY,
2024-04-19 10:05:43 +02:00
file_id UUID REFERENCES file (id) ON DELETE CASCADE NOT NULL
2024-04-16 22:07:00 +02:00
);