<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251027105014 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create table std_ads_zones to store ad display zones and their allowed formats';
}
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
CREATE TABLE `std_ads_zones` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`machine_name` VARCHAR(100) NOT NULL,
`name` VARCHAR(255) NOT NULL,
`description` VARCHAR(255) DEFAULT NULL,
`allowed_formats` JSON DEFAULT NULL,
`is_active` TINYINT(1) NOT NULL DEFAULT 1,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_ads_zone_machine_name` (`machine_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
SQL);
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE IF EXISTS `std_ads_zones`');
}
}