<?php
declare(strict_types=1);

return [
    'up' => "
        CREATE TABLE IF NOT EXISTS `facility_blackout_dates` (
            `id`              BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
            `facility_id`     BIGINT UNSIGNED NOT NULL,
            `blackout_date`   DATE NOT NULL,
            `start_time`      TIME NULL COMMENT 'NULL means entire day',
            `end_time`        TIME NULL,
            `reason`          VARCHAR(500) NULL,
            `created_by`      BIGINT UNSIGNED NULL,
            `created_at`      TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            INDEX `idx_fbd_facility_date` (`facility_id`, `blackout_date`),
            CONSTRAINT `fk_fbd_facility` FOREIGN KEY (`facility_id`) REFERENCES `facilities`(`id`) ON DELETE CASCADE
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
    ",
    'down' => "DROP TABLE IF EXISTS `facility_blackout_dates`",
];
