CREATE TABLE IF NOT EXISTS videos (
    id INT AUTO_INCREMENT PRIMARY KEY,
    uuid VARCHAR(36) NOT NULL UNIQUE,
    video_path TEXT NOT NULL,
    silenced_video_path TEXT,
    model_name VARCHAR(255)
);

CREATE TABLE IF NOT EXISTS audios (
    id INT AUTO_INCREMENT PRIMARY KEY,
    uuid VARCHAR(36) NOT NULL,
    type ENUM('original', 'formatted') NOT NULL,
    file_path TEXT NOT NULL,
    FOREIGN KEY (uuid) REFERENCES videos(uuid) ON DELETE CASCADE
);

CREATE TABLE IF NOT EXISTS reference_texts (
    id INT AUTO_INCREMENT PRIMARY KEY,
    uuid VARCHAR(36) NOT NULL,
    ref_text TEXT,
    FOREIGN KEY (uuid) REFERENCES videos(uuid) ON DELETE CASCADE
);
