CREATE TABLE IF NOT EXISTS page_formation_details (
    page_id INT UNSIGNED NOT NULL,
    objectives LONGTEXT NULL,
    target_skills LONGTEXT NULL,
    pedagogical_program LONGTEXT NULL,
    pedagogical_resources LONGTEXT NULL,
    pedagogical_methods LONGTEXT NULL,
    evaluation_methods LONGTEXT NULL,
    access_terms LONGTEXT NULL,
    instructors LONGTEXT NULL,
    equipment LONGTEXT NULL,
    training_contact LONGTEXT NULL,
    program_media_id INT UNSIGNED NULL,
    performance_media_id INT UNSIGNED NULL,
    created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (page_id),
    KEY idx_page_formation_details_program_media_id (program_media_id),
    KEY idx_page_formation_details_performance_media_id (performance_media_id),
    CONSTRAINT fk_page_formation_details_page FOREIGN KEY (page_id) REFERENCES pages(id) ON DELETE CASCADE,
    CONSTRAINT fk_page_formation_details_program_media FOREIGN KEY (program_media_id) REFERENCES media(id) ON DELETE SET NULL,
    CONSTRAINT fk_page_formation_details_performance_media FOREIGN KEY (performance_media_id) REFERENCES media(id) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
