migrations/Version20230301190904.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Utils\CommonFunctions;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20230301190904 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return '';
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         $this->addSql('ALTER TABLE licencia_conducir ADD antiguedad_licencia_anterior INT(11) DEFAULT NULL AFTER edad;');
  20.         $this->addSql('DELETE FROM licencia_conducir');
  21.         $this->addSql('ALTER TABLE licencia_conducir AUTO_INCREMENT = 1');
  22.         $this->addSql('DELETE FROM tipo_vehiculo');
  23.         $this->addSql('ALTER TABLE tipo_vehiculo AUTO_INCREMENT = 1');
  24.         $this->addSql(CommonFunctions::getFile(__DIR__ '/Data/LicenciasConducir/update_licencias.sql'));
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE licencia_conducir DROP antiguedad_licencia_anterior');
  30.         $this->addSql('DELETE FROM licencia_conducir');
  31.         $this->addSql('ALTER TABLE licencia_conducir AUTO_INCREMENT = 1');
  32.         $this->addSql('DELETE FROM tipo_vehiculo');
  33.         $this->addSql('ALTER TABLE tipo_vehiculo AUTO_INCREMENT = 1');
  34.     }
  35. }