migrations/Version20251117155057.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. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20251117155057 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Insert new ads zone: Mrec (300x250 for all devices)';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // INSERT da nova zona MREC
  18.         $this->addSql("
  19.             INSERT INTO std_ads_zones (machine_name, name, description, width, height, position, is_active, created_at, updated_at)
  20.             VALUES (
  21.                 'mrec',
  22.                 'Mrec',
  23.                 'O Mrec é um formato HTML5 exibido em todos os devices (Desktop, Tablet e Mobile). Formato: 300x250px. Tipos de ficheiro: JPG, PNG ou GIF (máx. 200KB).',
  24.                 300,
  25.                 250,
  26.                 'inline',
  27.                 1,
  28.                 NOW(),
  29.                 NOW()
  30.             );
  31.         ");
  32.     }
  33.     public function down(Schema $schema): void
  34.     {
  35.         // rollback do insert
  36.         $this->addSql("DELETE FROM std_ads_zones WHERE machine_name = 'mrec';");
  37.     }
  38. }