Version20171019130515.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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 Version20171019130515 extends AbstractMigration
  9. {
  10. /**
  11. * @param Schema $schema
  12. */
  13. public function up(Schema $schema)
  14. {
  15. $base = 1;
  16. $initial = 2;
  17. $this->addsql("UPDATE nap SET tenancy_id = " . $initial . " WHERE isnull(tenancy_id) or tenancy_id = " . $base);
  18. $this->addsql("UPDATE olt SET tenancy_id = " . $initial . " WHERE isnull(tenancy_id) or tenancy_id = " . $base);
  19. $this->addsql("UPDATE onu SET tenancy_id = " . $initial . " WHERE isnull(tenancy_id) or tenancy_id = " . $base);
  20. $this->addsql("UPDATE profile SET tenancy_id = " . $initial . " WHERE isnull(tenancy_id) or tenancy_id = " . $base);
  21. $this->addsql("UPDATE oltmodel SET tenancy_id = " . $base . " WHERE isnull(tenancy_id) or tenancy_id = 0");
  22. $this->addsql("UPDATE onumodel SET tenancy_id = " . $base . " WHERE isnull(tenancy_id) or tenancy_id = 0");
  23. }
  24. /**
  25. * @param Schema $schema
  26. */
  27. public function down(Schema $schema)
  28. {
  29. // this down() migration is auto-generated, please modify it to your needs
  30. }
  31. }