migrations/Version20250909133131.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 Version20250909192000 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Altera std_top10: adiciona colunas `order` (INT UNSIGNED DEFAULT 0) e `is_pinned` (TINYINT(1) DEFAULT 0).';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql(<<<'SQL'
  15.             ALTER TABLE `std_top10`
  16.               ADD COLUMN `order` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Ordem manual para exibição' AFTER `views_count`,
  17.               ADD COLUMN `is_pinned` TINYINT(1) NOT NULL DEFAULT 0 COMMENT 'Se true, nunca será desativado automaticamente';
  18.         SQL);
  19.     }
  20.     public function down(Schema $schema): void
  21.     {
  22.         $this->addSql(<<<'SQL'
  23.             ALTER TABLE `std_top10`
  24.               DROP COLUMN `order`,
  25.               DROP COLUMN `is_pinned`;
  26.         SQL);
  27.     }
  28. }