Files
DanceVideos/model/videos_playlists.sql
Gabriel Radureau 9cb9790974 first streamlit poc
2025-10-12 14:59:40 +02:00

17 lines
647 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 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 lordre 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
);