migrations/Version20251027103900.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20251027103900 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Create table std_ads_clients (internal clients for ad campaigns)';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql(<<<'SQL'
  15.             CREATE TABLE `std_ads_clients` (
  16.               `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  17.               `name` VARCHAR(255) NOT NULL,
  18.               `nif` VARCHAR(50) NULL,
  19.               `email` VARCHAR(255) NULL,
  20.               `phone` VARCHAR(50) NULL,
  21.               `is_active` TINYINT(1) DEFAULT 1,
  22.               `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  23.               `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  24.               PRIMARY KEY (`id`)
  25.             ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  26.         SQL);
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         $this->addSql('DROP TABLE IF EXISTS `std_ads_clients`');
  31.     }
  32. }