src/Migrations/Version20201125194514.php line 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 Version20201125194514 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 scholar_competencies_relation (profile_id INT NOT NULL, competence_id INT NOT NULL, INDEX IDX_EE7B776CCCFA12B8 (profile_id), INDEX IDX_EE7B776C15761DAB (competence_id), PRIMARY KEY(profile_id, competence_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE scholar_achievements_relation (profile_id INT NOT NULL, achievement_id INT NOT NULL, INDEX IDX_7167AF54CCFA12B8 (profile_id), INDEX IDX_7167AF54B3EC99FE (achievement_id), PRIMARY KEY(profile_id, achievement_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE scholar_competencies_relation ADD CONSTRAINT FK_EE7B776CCCFA12B8 FOREIGN KEY (profile_id) REFERENCES scholar_profile (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE scholar_competencies_relation ADD CONSTRAINT FK_EE7B776C15761DAB FOREIGN KEY (competence_id) REFERENCES scholar_competence (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE scholar_achievements_relation ADD CONSTRAINT FK_7167AF54CCFA12B8 FOREIGN KEY (profile_id) REFERENCES scholar_profile (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE scholar_achievements_relation ADD CONSTRAINT FK_7167AF54B3EC99FE FOREIGN KEY (achievement_id) REFERENCES scholar_achievement (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE phone_competencies_relation');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE phone_competencies_relation (profile_id INT NOT NULL, competence_id INT NOT NULL, INDEX IDX_C0DC624A15761DAB (competence_id), INDEX IDX_C0DC624ACCFA12B8 (profile_id), PRIMARY KEY(profile_id, competence_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE phone_competencies_relation ADD CONSTRAINT FK_C0DC624A15761DAB FOREIGN KEY (competence_id) REFERENCES scholar_competence (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE phone_competencies_relation ADD CONSTRAINT FK_C0DC624ACCFA12B8 FOREIGN KEY (profile_id) REFERENCES scholar_profile (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE scholar_competencies_relation');
$this->addSql('DROP TABLE scholar_achievements_relation');
}
}