migrations/Version20251031131756.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 Version20251031131756 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Creación de tabla color';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // Crear tabla color
  18.         $this->addSql('CREATE TABLE color (
  19.             id INT AUTO_INCREMENT NOT NULL,
  20.             clase VARCHAR(255) NOT NULL,
  21.             tipo VARCHAR(100) NOT NULL,
  22.             created_at DATETIME NOT NULL,
  23.             updated_at DATETIME NOT NULL,
  24.             deleted_at DATETIME DEFAULT NULL,
  25.             PRIMARY KEY(id)
  26.         ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  27.     }
  28.     public function down(Schema $schema): void
  29.     {
  30.         // Eliminar tabla color
  31.         $this->addSql('DROP TABLE color');
  32.     }
  33. }