123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Application\Migrations;
- use Doctrine\DBAL\Migrations\AbstractMigration;
- use Doctrine\DBAL\Schema\Schema;
- /**
- * Auto-generated Migration: Please modify to your needs!
- */
- class Version20180326154629 extends AbstractMigration
- {
- /**
- * @param Schema $schema
- */
- public function up(Schema $schema)
- {
- // this up() migration is auto-generated, please modify it to your needs
- $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
- $this->addSql('ALTER TABLE `service_port` DROP FOREIGN KEY `FK_8DD2E92069FFAD89`;
- ALTER TABLE `service_port` ADD CONSTRAINT `FK_8DD2E92069FFAD89` FOREIGN KEY (`olt_id`) REFERENCES `olt`(`id`) ON DELETE SET NULL ON UPDATE RESTRICT;
- ALTER TABLE `service_port` DROP FOREIGN KEY `FK_8DD2E920AB83998C`; ALTER TABLE `service_port` ADD CONSTRAINT `FK_8DD2E920AB83998C` FOREIGN KEY (`onu_id`) REFERENCES `onu`(`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
- ');
- }
- /**
- * @param Schema $schema
- */
- public function down(Schema $schema)
- {
- // this down() migration is auto-generated, please modify it to your needs
- $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
- }
- }
|