<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Utils\CommonFunctions;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230125175903 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE licencia_conducir DROP FOREIGN KEY FK_E20963FD10D3FB8D');
$this->addSql('TRUNCATE licencia_conducir');
$this->addSql('DROP TABLE licencia_conducir');
$this->addSql('CREATE TABLE licencia_conducir (id INT AUTO_INCREMENT NOT NULL, tipo_vehiculo_id INT DEFAULT NULL, clase VARCHAR(255) NOT NULL, descripcion VARCHAR(1200) NOT NULL, edad INT DEFAULT NULL, licencias_anteriores VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_E20963FD10D3FB8D (tipo_vehiculo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE licencia_conducir ADD CONSTRAINT FK_E20963FD10D3FB8D FOREIGN KEY (tipo_vehiculo_id) REFERENCES tipo_vehiculo (id)');
$this->addSql('DELETE FROM tipo_vehiculo');
$this->addSql('ALTER TABLE tipo_vehiculo AUTO_INCREMENT = 1');
$this->addSql(CommonFunctions::getFile(__DIR__ . '/Data/LicenciasConducir/update_licencias.sql'));
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}