Skip to content

Commit b1d35e2

Browse files
committed
Adjust migration files.
1 parent af48a93 commit b1d35e2

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

config/Migrations/20160504190435_InitGeo.php

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,51 @@
11
<?php
22

3-
use Phinx\Migration\AbstractMigration;
3+
use Migrations\BaseMigration;
44

55
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
66
// phpcs:disable PSR2R.Classes.ClassFileName.NoMatch
7-
class InitGeo extends AbstractMigration {
7+
class InitGeo extends BaseMigration {
88

99
/**
1010
* @inheritDoc
1111
*/
1212
public function up() {
13-
if (!$this->hasTable('geocoded_addresses')) {
14-
$this->table('geocoded_addresses')
15-
->addColumn('address', 'string', [
16-
'default' => null,
17-
'limit' => 255,
18-
'null' => false,
19-
])
20-
->addColumn('formatted_address', 'string', [
21-
'default' => null,
22-
'limit' => 255,
23-
'null' => true,
24-
])
25-
->addColumn('country', 'string', [
26-
'default' => null,
27-
'limit' => 3,
28-
'null' => true,
29-
])
30-
->addColumn('lat', 'float', [
31-
'default' => null,
32-
'null' => true,
33-
])
34-
->addColumn('lng', 'float', [
35-
'default' => null,
36-
'null' => true,
37-
])
38-
->addColumn('data', 'text', [
39-
'default' => null,
40-
'limit' => null,
41-
'null' => true,
42-
])
43-
->addIndex(
44-
[
45-
'address',
46-
],
47-
['unique' => true],
48-
)
49-
->create();
50-
}
13+
$this->table('geocoded_addresses')
14+
->addColumn('address', 'string', [
15+
'default' => null,
16+
'limit' => 255,
17+
'null' => false,
18+
])
19+
->addColumn('formatted_address', 'string', [
20+
'default' => null,
21+
'limit' => 255,
22+
'null' => true,
23+
])
24+
->addColumn('country', 'string', [
25+
'default' => null,
26+
'limit' => 3,
27+
'null' => true,
28+
])
29+
->addColumn('lat', 'float', [
30+
'default' => null,
31+
'null' => true,
32+
])
33+
->addColumn('lng', 'float', [
34+
'default' => null,
35+
'null' => true,
36+
])
37+
->addColumn('data', 'text', [
38+
'default' => null,
39+
'limit' => null,
40+
'null' => true,
41+
])
42+
->addIndex(
43+
[
44+
'address',
45+
],
46+
['unique' => true],
47+
)
48+
->create();
5149
}
5250

5351
/**

config/Migrations/20160504190436_MigrationsGeoCreated.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
use Phinx\Migration\AbstractMigration;
3+
use Migrations\BaseMigration;
44

55
// phpcs:disable PSR1.Classes.ClassDeclaration.MissingNamespace
66
// phpcs:disable PSR2R.Classes.ClassFileName.NoMatch
7-
class MigrationsGeoCreated extends AbstractMigration {
7+
class MigrationsGeoCreated extends BaseMigration {
88

99
/**
1010
* @inheritDoc

0 commit comments

Comments
 (0)