migrations/Version20240129063638.php line 1

Open in your IDE?
  1. <?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 Version20240129063638 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 user_ads ADD geographic_zone_id INT DEFAULT NULL');
            $this->addSql('ALTER TABLE user_ads ADD CONSTRAINT FK_95DF97AB58420761 FOREIGN KEY (geographic_zone_id) REFERENCES geographic_zone (id)');
            $this->addSql('CREATE INDEX IDX_95DF97AB58420761 ON user_ads (geographic_zone_id)');        
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            
            $this->addSql('ALTER TABLE user_ads DROP FOREIGN KEY FK_95DF97AB58420761');
            $this->addSql('DROP INDEX IDX_95DF97AB58420761 ON user_ads');
            $this->addSql('ALTER TABLE user_ads DROP geographic_zone_id');
        }
    }