src/Migrations/Version20201022203016.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 Version20201022203016 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 phone_competencies_relation (profile_id INT NOT NULL, competence_id INT NOT NULL, INDEX IDX_C0DC624ACCFA12B8 (profile_id), INDEX IDX_C0DC624A15761DAB (competence_id), PRIMARY KEY(profile_id, competence_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE phone_competencies_relation ADD CONSTRAINT FK_C0DC624ACCFA12B8 FOREIGN KEY (profile_id) REFERENCES scholar_profile (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE phone_competencies_relation ADD CONSTRAINT FK_C0DC624A15761DAB FOREIGN KEY (competence_id) REFERENCES scholar_competence (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE profile_competence');
$this->addSql('ALTER TABLE scholar_profile DROP FOREIGN KEY FK_14FBF773A76ED395');
$this->addSql('ALTER TABLE scholar_profile ADD CONSTRAINT FK_14FBF773A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE profile_competence (profile_id INT NOT NULL, competence_id INT NOT NULL, INDEX IDX_53BF5F2215761DAB (competence_id), INDEX IDX_53BF5F22CCFA12B8 (profile_id), PRIMARY KEY(profile_id, competence_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE profile_competence ADD CONSTRAINT FK_53BF5F2215761DAB FOREIGN KEY (competence_id) REFERENCES scholar_competence (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE profile_competence ADD CONSTRAINT FK_53BF5F22CCFA12B8 FOREIGN KEY (profile_id) REFERENCES scholar_profile (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE phone_competencies_relation');
$this->addSql('ALTER TABLE scholar_profile DROP FOREIGN KEY FK_14FBF773A76ED395');
$this->addSql('ALTER TABLE scholar_profile ADD CONSTRAINT FK_14FBF773A76ED395 FOREIGN KEY (user_id) REFERENCES organisation_user (id)');
}
}