watchdogs/migrations/0005_history.sql
JMARyA a0e7c5d3c1
Some checks failed
ci/woodpecker/push/build Pipeline failed
history feature
2024-12-22 20:19:52 +01:00

9 lines
333 B
SQL

CREATE TABLE IF NOT EXISTS video_history (
id BIGSERIAL PRIMARY KEY,
username VARCHAR(255) NOT NULL,
video_id UUID NOT NULL,
timestamp TIMESTAMPTZ NOT NULL DEFAULT NOW(),
FOREIGN KEY (username) REFERENCES users (username) ON DELETE CASCADE,
FOREIGN KEY (video_id) REFERENCES videos (id) ON DELETE CASCADE
);