Change Movie database structure and seed value

This commit is contained in:
Esa Kataja
2024-11-09 18:14:20 +02:00
parent a52b4d7e1b
commit 88e1d1c54b
2 changed files with 21 additions and 7 deletions
+15 -3
View File
@@ -15,9 +15,11 @@ CREATE TABLE movies (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
name TEXT NOT NULL,
imdb_id TEXT UNIQUE,
actors TEXT,
release_year INTEGER,
actors TEXT[],
release_date DATE DEFAULT NULL,
plot TEXT,
showtime DATE DEFAULT NULL,
is_watched BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
modified_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
@@ -47,4 +49,14 @@ CREATE TABLE log (
message TEXT NOT NULL,
message_type TEXT NOT NULL,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
);
-- Add placeholder data
INSERT INTO movies (name, imdb_id, actors, release_date, plot, showtime)
VALUES ('A Maple Valley Christmas',
'tt21841642',
['Peyton List', 'Andrew W. Walker', 'Frances Flanagan'],
'2022-11-05',
'Erica is a rancher who has spent her whole life working the family farm with her mother and sister.
When Aaron arrives and disrupts her plans, she starts to question what it is she actually wants.',
'2024-12-01');