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