-- Table des labels (mots-clés / tags indépendants)
CREATE TABLE IF NOT EXISTS labels (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  name VARCHAR(100) UNIQUE NOT NULL
);

-- Table d'association entre vidéos et labels (relation many-to-many)
CREATE TABLE IF NOT EXISTS video_labels (
  video_file_name VARCHAR(255),
  label_id INTEGER,
  PRIMARY KEY (video_file_name, label_id),
  FOREIGN KEY (video_file_name) REFERENCES videos(file_name) ON DELETE CASCADE,
  FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE
);