Version20180326154629.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Application\Migrations;
  3. use Doctrine\DBAL\Migrations\AbstractMigration;
  4. use Doctrine\DBAL\Schema\Schema;
  5. /**
  6. * Auto-generated Migration: Please modify to your needs!
  7. */
  8. class Version20180326154629 extends AbstractMigration
  9. {
  10. /**
  11. * @param Schema $schema
  12. */
  13. public function up(Schema $schema)
  14. {
  15. // this up() migration is auto-generated, please modify it to your needs
  16. $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
  17. $this->addSql('ALTER TABLE `service_port` DROP FOREIGN KEY `FK_8DD2E92069FFAD89`;
  18. ALTER TABLE `service_port` ADD CONSTRAINT `FK_8DD2E92069FFAD89` FOREIGN KEY (`olt_id`) REFERENCES `olt`(`id`) ON DELETE SET NULL ON UPDATE RESTRICT;
  19. 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;
  20. ');
  21. }
  22. /**
  23. * @param Schema $schema
  24. */
  25. public function down(Schema $schema)
  26. {
  27. // this down() migration is auto-generated, please modify it to your needs
  28. $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
  29. }
  30. }