<?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 Version20251207155903 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 asistencia_expo ADD COLUMN IF NOT EXISTS embajador_participante_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE asistencia_expo ADD COLUMN IF NOT EXISTS monto INT DEFAULT NULL');
$this->addSql('DO $$ BEGIN IF NOT EXISTS (SELECT 1 FROM information_schema.table_constraints WHERE constraint_name = \'FK_10B72DDE4DAF72D7\') THEN ALTER TABLE asistencia_expo ADD CONSTRAINT FK_10B72DDE4DAF72D7 FOREIGN KEY (embajador_participante_id) REFERENCES embajador_participante (id) NOT DEFERRABLE INITIALLY IMMEDIATE; END IF; END $$');
$this->addSql('CREATE INDEX IF NOT EXISTS IDX_10B72DDE4DAF72D7 ON asistencia_expo (embajador_participante_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE asistencia_expo DROP CONSTRAINT FK_10B72DDE4DAF72D7');
$this->addSql('DROP INDEX IDX_10B72DDE4DAF72D7');
$this->addSql('ALTER TABLE asistencia_expo DROP embajador_participante_id');
$this->addSql('ALTER TABLE asistencia_expo DROP monto');
}
}