first streamlit poc
This commit is contained in:
17
model/videos_playlists.sql
Normal file
17
model/videos_playlists.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Table des playlists
|
||||
CREATE TABLE IF NOT EXISTS playlists (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name VARCHAR(100) UNIQUE NOT NULL,
|
||||
description TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- Table d'association entre vidéos et playlists (relation many-to-many)
|
||||
CREATE TABLE IF NOT EXISTS video_playlists (
|
||||
video_file_name VARCHAR(255),
|
||||
playlist_id INTEGER,
|
||||
position INTEGER, -- pour gérer l’ordre dans la playlist
|
||||
PRIMARY KEY (video_file_name, playlist_id),
|
||||
FOREIGN KEY (video_file_name) REFERENCES videos(file_name) ON DELETE CASCADE,
|
||||
FOREIGN KEY (playlist_id) REFERENCES playlists(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user