watchdogs/migrations/0005_history.sql

10 lines
333 B
MySQL
Raw Normal View History

2024-12-22 20:19:52 +01:00
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
);