<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20251027103900 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create table std_ads_clients (internal clients for ad campaigns)';
}
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
CREATE TABLE `std_ads_clients` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`nif` VARCHAR(50) NULL,
`email` VARCHAR(255) NULL,
`phone` VARCHAR(50) NULL,
`is_active` TINYINT(1) 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`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
SQL);
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE IF EXISTS `std_ads_clients`');
}
}