| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Version20180206181038 extends AbstractMigration |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @param Schema $schema |
||
| 15 | */ |
||
| 16 | public function up(Schema $schema) |
||
| 17 | { |
||
| 18 | // this up() migration is auto-generated, please modify it to your needs |
||
| 19 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
| 20 | |||
| 21 | $this->addSql('CREATE TABLE event_speakers_committee (speaker_id INT NOT NULL, event_id INT NOT NULL, INDEX IDX_A1D0B356D04A0F27 (speaker_id), INDEX IDX_A1D0B35671F7E88B (event_id), PRIMARY KEY(speaker_id, event_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'); |
||
| 22 | $this->addSql('ALTER TABLE event_speakers_committee ADD CONSTRAINT FK_A1D0B356D04A0F27 FOREIGN KEY (speaker_id) REFERENCES event__speakers (id) ON DELETE CASCADE'); |
||
| 23 | $this->addSql('ALTER TABLE event_speakers_committee ADD CONSTRAINT FK_A1D0B35671F7E88B FOREIGN KEY (event_id) REFERENCES event__events (id) ON DELETE CASCADE'); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param Schema $schema |
||
| 28 | */ |
||
| 29 | public function down(Schema $schema) |
||
| 30 | { |
||
| 31 | // this down() migration is auto-generated, please modify it to your needs |
||
| 32 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
| 33 | |||
| 34 | $this->addSql('DROP TABLE event_speakers_committee'); |
||
| 35 | } |
||
| 37 |