<?php
declare(strict_types=1);

return [
    'up' => "
CREATE TABLE IF NOT EXISTS sa_mirror_templates (
    id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    facility_id INT UNSIGNED NOT NULL,
    name VARCHAR(100) NOT NULL,
    description TEXT NULL,
    template_data JSON NOT NULL COMMENT 'Array of {unit_id, day_of_week, start_time, end_time, booking_type, group_id}',
    created_by BIGINT UNSIGNED NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    INDEX idx_smt_facility (facility_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",

    'down' => "DROP TABLE IF EXISTS sa_mirror_templates",
];
