<?php
declare(strict_types=1);

return [
    'up' => "CREATE TABLE IF NOT EXISTS `mirror_grids` (
    `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    `facility_id` BIGINT UNSIGNED NOT NULL,
    `name_ar` VARCHAR(300) NOT NULL,
    `rows_count` INT UNSIGNED NOT NULL DEFAULT 4,
    `cols_count` INT UNSIGNED NOT NULL DEFAULT 6,
    `is_active` TINYINT(1) NOT NULL DEFAULT 1,
    `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `created_by` BIGINT UNSIGNED NULL,
    INDEX `idx_mg_facility` (`facility_id`),
    CONSTRAINT `fk_mg_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 `mirror_grids`",
];
