Version20171107185545.php 787 B

12345678910111213141516171819202122232425262728293031323334
  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 Version20171107185545 extends AbstractMigration
  9. {
  10. /**
  11. * @param Schema $schema
  12. */
  13. public function up(Schema $schema)
  14. {
  15. $this->addsql(
  16. "UPDATE onu AS o
  17. JOIN nap AS n ON o.nap_id = n.id
  18. SET o.link = JSON_EXTRACT(n.extra_data, '$.link'), o.slot = JSON_EXTRACT(n.extra_data, '$.slot')
  19. WHERE o.link=0 AND o.slot=0;"
  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. }
  29. }