adding example apps, fixing powerup issues
[feisty_meow.git] / production / example_apps / zippy_maps / config / Migrations / 20170712152942_DropLatlongFromLocationsTable.php
1 <?php
2 use Migrations\AbstractMigration;
3 class DropLatlongFromLocationsTable extends AbstractMigration {
4         
5         /**
6          * going forward, we have two columns (lat and lng) for the geo coords.  so we're getting rid
7          * of the latlong combined column.
8          */
9         public function up() {
10                 $this->table ( 'locations' )->removeColumn ( 'latlong' )->update ();
11         }
12         /**
13          * but for preservation of former realities, we re-add the latlong column if we're going backwards.
14          * this supports our code for transmogrifying the coordinates between two column format and one
15          * column fomat.
16          */
17         public function down() {
18                 $this->table ( 'locations' )->addColumn ( 'latlong', 'string', [ 
19                                 'length' => 255,
20                                 'null' => true 
21                 ] )->update ();
22         }
23 }