This commit is contained in:
parent
95c4cf6fe1
commit
a0e7c5d3c1
8 changed files with 111 additions and 23 deletions
9
migrations/0005_history.sql
Normal file
9
migrations/0005_history.sql
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
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
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue