-
Notifications
You must be signed in to change notification settings - Fork 0
/
20190316175201_places.php
57 lines (54 loc) · 3.31 KB
/
20190316175201_places.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
use Phinx\Migration\AbstractMigration;
class Places extends AbstractMigration {
/**
*/
public function change() {
$table = $this->table('places', ['comment' => 'Adresní místa z celé ČR']);
$table
->addColumn('adm', 'integer',
['comment' => 'Kód ADM', 'signed' => false])
->addColumn('code', 'integer',
['comment' => 'Kód obce', 'signed' => false])
->addColumn('name', 'string', ['comment' => 'Název obce'])
->addColumn('momc_code', 'integer',
['comment' => 'Kód MOMC', 'signed' => false, 'null' => true])
->addColumn('momc_name', 'string', ['comment' => 'Název MOMC'])
->addColumn('mop_code', 'integer',
['comment' => 'Kód MOP', 'signed' => false])
->addColumn('mop_name', 'string', ['comment' => 'Název MOP'])
->addColumn('district_code', 'integer',
['comment' => 'Kód části obce', 'signed' => false])
->addColumn('district_name', 'string',
['comment' => 'Název části obce'])
->addColumn('street_code', 'integer',
['comment' => 'Kód ulice', 'signed' => false])
->addColumn('street_name', 'string', ['comment' => 'Název ulice'])
->addColumn('so_type', 'string', ['comment' => 'Typ SO'])
->addColumn('house_number', 'integer',
['comment' => 'Číslo domovní', 'signed' => false])
->addColumn('orientation_number', 'integer',
['comment' => 'Číslo orientační', 'signed' => false, 'null' => true])
->addColumn('orientation_number_mark', 'string',
['comment' => 'Znak čísla orientačního'])
->addColumn('zip', 'string',
['comment' => 'PSČ', 'signed' => false, 'limit' => 5])
->addColumn('y', 'float', ['comment' => 'S-JTSK Souřadnice Y', 'signed' => false])
->addColumn('x', 'float', ['comment' => 'S-JTSK Souřadnice X', 'signed' => false])
->addColumn('latitude', 'decimal', ['comment' => 'WGS 84 Y', 'signed' => false, 'scale'=>10, 'precision' => 30])
->addColumn('longitude', 'decimal', ['comment' => 'WGS 84 X', 'signed' => false, 'scale'=>10, 'precision' => 30])
->addColumn('valid_from', 'datetime', ['comment' => 'Platí Od'])
->addIndex(['adm'], ['unique' => true, 'name' => 'idx_adm'])
->addIndex(['code'], ['name' => 'idx_code'])
->addIndex(['name'], ['name' => 'idx_name'])
->addIndex(['street_name'], ['name' => 'idx_stret_name'])
->addIndex(['house_number'], ['name' => 'idx_house_number'])
->addIndex(['orientation_number'], ['name' => 'idx_orientation_number'])
->addIndex(['zip'], ['name' => 'idx_zip'])
->addIndex(['x', 'y'], ['name' => 'sjstk'])
->addIndex(['y', 'x'], ['name' => 'sjstk_reverse'])
->addIndex(['long', 'lat'], ['name' => 'gps'])
->addIndex(['lat', 'long'], ['name' => 'gps_reverse'])
->create();
}
}