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

17 lines
355 B
SQL

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,
file_id UUID REFERENCES file (id) NOT NULL
);