<?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 Version20231212092629 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('CREATE TABLE offer_entry (id INT AUTO_INCREMENT NOT NULL, offer_id INT DEFAULT NULL, date_from DATETIME DEFAULT NULL, date_to DATETIME DEFAULT NULL, note VARCHAR(2048) DEFAULT NULL, INDEX IDX_A80CE09953C674EE (offer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE offer_entry ADD CONSTRAINT FK_A80CE09953C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping DROP FOREIGN KEY FK_8DE7C27D53C674EE');
$this->addSql('DROP INDEX IDX_8DE7C27D53C674EE ON bopartner_profile_offer_mapping');
$this->addSql('DROP INDEX `primary` ON bopartner_profile_offer_mapping');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping CHANGE offer_id offer_entry_id INT NOT NULL');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping ADD CONSTRAINT FK_8DE7C27DC34BF920 FOREIGN KEY (offer_entry_id) REFERENCES offer_entry (id)');
$this->addSql('CREATE INDEX IDX_8DE7C27DC34BF920 ON bopartner_profile_offer_mapping (offer_entry_id)');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping ADD PRIMARY KEY (bopartner_profile_id, offer_entry_id)');
$this->addSql('ALTER TABLE company_profile_offer_mapping DROP FOREIGN KEY FK_DFDC4A4453C674EE');
$this->addSql('DROP INDEX IDX_DFDC4A4453C674EE ON company_profile_offer_mapping');
$this->addSql('DROP INDEX `primary` ON company_profile_offer_mapping');
$this->addSql('ALTER TABLE company_profile_offer_mapping CHANGE offer_id offer_entry_id INT NOT NULL');
$this->addSql('ALTER TABLE company_profile_offer_mapping ADD CONSTRAINT FK_DFDC4A44C34BF920 FOREIGN KEY (offer_entry_id) REFERENCES offer_entry (id)');
$this->addSql('CREATE INDEX IDX_DFDC4A44C34BF920 ON company_profile_offer_mapping (offer_entry_id)');
$this->addSql('ALTER TABLE company_profile_offer_mapping ADD PRIMARY KEY (company_profile_id, offer_entry_id)');
$this->addSql('ALTER TABLE school_profile_offer_mapping DROP FOREIGN KEY FK_9C8ED68353C674EE');
$this->addSql('DROP INDEX IDX_9C8ED68353C674EE ON school_profile_offer_mapping');
$this->addSql('DROP INDEX `primary` ON school_profile_offer_mapping');
$this->addSql('ALTER TABLE school_profile_offer_mapping CHANGE offer_id offer_entry_id INT NOT NULL');
$this->addSql('ALTER TABLE school_profile_offer_mapping ADD CONSTRAINT FK_9C8ED683C34BF920 FOREIGN KEY (offer_entry_id) REFERENCES offer_entry (id)');
$this->addSql('CREATE INDEX IDX_9C8ED683C34BF920 ON school_profile_offer_mapping (offer_entry_id)');
$this->addSql('ALTER TABLE school_profile_offer_mapping ADD PRIMARY KEY (school_profile_id, offer_entry_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping DROP FOREIGN KEY FK_8DE7C27DC34BF920');
$this->addSql('ALTER TABLE company_profile_offer_mapping DROP FOREIGN KEY FK_DFDC4A44C34BF920');
$this->addSql('ALTER TABLE school_profile_offer_mapping DROP FOREIGN KEY FK_9C8ED683C34BF920');
$this->addSql('ALTER TABLE offer_entry DROP FOREIGN KEY FK_A80CE09953C674EE');
$this->addSql('DROP TABLE offer_entry');
$this->addSql('DROP INDEX IDX_9C8ED683C34BF920 ON school_profile_offer_mapping');
$this->addSql('DROP INDEX `PRIMARY` ON school_profile_offer_mapping');
$this->addSql('ALTER TABLE school_profile_offer_mapping CHANGE offer_entry_id offer_id INT NOT NULL');
$this->addSql('ALTER TABLE school_profile_offer_mapping ADD CONSTRAINT FK_9C8ED68353C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('CREATE INDEX IDX_9C8ED68353C674EE ON school_profile_offer_mapping (offer_id)');
$this->addSql('ALTER TABLE school_profile_offer_mapping ADD PRIMARY KEY (school_profile_id, offer_id)');
$this->addSql('DROP INDEX IDX_8DE7C27DC34BF920 ON bopartner_profile_offer_mapping');
$this->addSql('DROP INDEX `PRIMARY` ON bopartner_profile_offer_mapping');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping CHANGE offer_entry_id offer_id INT NOT NULL');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping ADD CONSTRAINT FK_8DE7C27D53C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('CREATE INDEX IDX_8DE7C27D53C674EE ON bopartner_profile_offer_mapping (offer_id)');
$this->addSql('ALTER TABLE bopartner_profile_offer_mapping ADD PRIMARY KEY (bopartner_profile_id, offer_id)');
$this->addSql('DROP INDEX IDX_DFDC4A44C34BF920 ON company_profile_offer_mapping');
$this->addSql('DROP INDEX `PRIMARY` ON company_profile_offer_mapping');
$this->addSql('ALTER TABLE company_profile_offer_mapping CHANGE offer_entry_id offer_id INT NOT NULL');
$this->addSql('ALTER TABLE company_profile_offer_mapping ADD CONSTRAINT FK_DFDC4A4453C674EE FOREIGN KEY (offer_id) REFERENCES offer (id)');
$this->addSql('CREATE INDEX IDX_DFDC4A4453C674EE ON company_profile_offer_mapping (offer_id)');
$this->addSql('ALTER TABLE company_profile_offer_mapping ADD PRIMARY KEY (company_profile_id, offer_id)');
}
}