finish postgres

This commit is contained in:
JMARyA 2024-10-04 14:38:35 +02:00
parent 7b7e1a4014
commit 08e24f63f4
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
16 changed files with 454 additions and 306 deletions

View file

@ -47,3 +47,12 @@ CREATE TABLE IF NOT EXISTS events (
);
SELECT create_hypertable('events', by_range('time'));
CREATE TABLE IF NOT EXISTS playlist (
id UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid(),
owner VARCHAR(255) NOT NULL,
title text NOT NULL,
visibility text NOT NULL DEFAULT 'private' CHECK (visibility IN ('public', 'private')),
tracks UUID[] NOT NULL DEFAULT [],
FOREIGN KEY(owner) REFERENCES user(username)
);