<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20251029194027 extends AbstractMigration
{
public function getDescription(): string
{
return 'Crear tabla sponsor';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE sponsor (
id INT AUTO_INCREMENT NOT NULL,
titulo VARCHAR(255) NOT NULL,
imagen VARCHAR(255) DEFAULT NULL,
url VARCHAR(255) NOT NULL,
activo TINYINT(1) DEFAULT 1 NOT NULL,
posicion INT DEFAULT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
deleted_at DATETIME DEFAULT NULL,
INDEX IDX_TITULO (titulo),
INDEX IDX_ACTIVO (activo),
INDEX IDX_POSICION (posicion),
INDEX IDX_DELETED_AT (deleted_at),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE sponsor');
}
}