migrations/Version20251111154739.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 Version20251111154739 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Crea la tabla clima con campos id, nombre e icono';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE clima (
  18.             id INT AUTO_INCREMENT NOT NULL,
  19.             nombre VARCHAR(255) NOT NULL,
  20.             icono VARCHAR(255) DEFAULT NULL,
  21.             activo TINYINT(1) DEFAULT 1 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.         $this->addSql('DROP TABLE clima');
  31.     }
  32. }