| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function up(Schema $schema): void |
||
| 13 | { |
||
| 14 | $this->addSql('DROP INDEX institution_longitude_idx ON institution'); |
||
| 15 | $this->addSql('DROP INDEX institution_latitude_idx ON institution'); |
||
| 16 | $this->addSql('ALTER TABLE institution ADD location POINT DEFAULT NULL COMMENT \'(DC2Type:point)\''); |
||
| 17 | $this->addSql('UPDATE institution SET longitude = NULL, latitude = NULL WHERE longitude = 0 OR latitude = 0'); |
||
| 18 | $this->addSql('UPDATE institution SET location = ST_PointFromText(CONCAT(\'POINT(\', longitude ,\' \', latitude,\')\')) WHERE longitude IS NOT NULL AND latitude IS NOT NULL'); |
||
| 19 | $this->addSql('ALTER TABLE institution DROP latitude, DROP longitude'); |
||
| 20 | |||
| 21 | $this->addSql('DROP INDEX card_latitude_idx ON card'); |
||
| 22 | $this->addSql('DROP INDEX card_longitude_idx ON card'); |
||
| 23 | $this->addSql('ALTER TABLE card ADD location POINT DEFAULT NULL COMMENT \'(DC2Type:point)\''); |
||
| 24 | $this->addSql('UPDATE card SET longitude = NULL, latitude = NULL WHERE longitude = 0 OR latitude = 0'); |
||
| 25 | $this->addSql('UPDATE card SET location = ST_PointFromText(CONCAT(\'POINT(\', longitude ,\' \', latitude,\')\')) WHERE longitude IS NOT NULL AND latitude IS NOT NULL'); |
||
| 26 | $this->addSql('ALTER TABLE card DROP latitude, DROP longitude'); |
||
| 27 | } |
||
| 29 |