migrations/Version20251029194027.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 Version20251029194027 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Crear tabla sponsor';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE sponsor (
  18.             id INT AUTO_INCREMENT NOT NULL,
  19.             titulo VARCHAR(255) NOT NULL,
  20.             imagen VARCHAR(255) DEFAULT NULL,
  21.             url VARCHAR(255) NOT NULL,
  22.             activo TINYINT(1) DEFAULT 1 NOT NULL,
  23.             posicion INT DEFAULT NULL,
  24.             created_at DATETIME NOT NULL,
  25.             updated_at DATETIME NOT NULL,
  26.             deleted_at DATETIME DEFAULT NULL,
  27.             INDEX IDX_TITULO (titulo),
  28.             INDEX IDX_ACTIVO (activo),
  29.             INDEX IDX_POSICION (posicion),
  30.             INDEX IDX_DELETED_AT (deleted_at),
  31.             PRIMARY KEY(id)
  32.         ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         $this->addSql('DROP TABLE sponsor');
  37.     }
  38. }