12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace Application\Migrations;
- use Doctrine\DBAL\Migrations\AbstractMigration;
- use Doctrine\DBAL\Schema\Schema;
- class Version20171107185545 extends AbstractMigration
- {
- /**
- * @param Schema $schema
- */
- public function up(Schema $schema)
- {
- $this->addsql(
- "UPDATE nap AS n
- JOIN olt AS o ON o.name = JSON_EXTRACT(n.extra_data, '$.olt')
- SET n.link = JSON_EXTRACT(n.extra_data, '$.link'),
- n.slot = JSON_EXTRACT(n.extra_data, '$.slot'),
- n.olt_id = o.id
- WHERE n.link = 0 AND n.slot = 0;"
- );
- }
- /**
- * @param Schema $schema
- */
- public function down(Schema $schema)
- {
- // this down() migration is auto-generated, please modify it to your needs
- }
- }
|