@@ 8-27 (lines=20) @@ | ||
5 | /** |
|
6 | * Class m180618_133225_add_columns_to_contacts_table |
|
7 | */ |
|
8 | class m180618_133225_add_columns_to_contacts_table extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * {@inheritdoc} |
|
12 | */ |
|
13 | public function safeUp() |
|
14 | { |
|
15 | $this->addColumn('contacts', 'mapQ', $this->string()); |
|
16 | $this->addColumn('contacts', 'mapZoom', $this->integer(3)); |
|
17 | } |
|
18 | ||
19 | /** |
|
20 | * {@inheritdoc} |
|
21 | */ |
|
22 | public function safeDown() |
|
23 | { |
|
24 | $this->dropColumn('contacts', 'mapZoom'); |
|
25 | $this->dropColumn('contacts', 'mapQ'); |
|
26 | } |
|
27 | } |
|
28 |
@@ 8-36 (lines=29) @@ | ||
5 | /** |
|
6 | * Class m200609_141628_add_alias_to_pages_table |
|
7 | */ |
|
8 | class m200609_141628_add_alias_to_pages_table extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * {@inheritdoc} |
|
12 | */ |
|
13 | public function safeUp() |
|
14 | { |
|
15 | $this->addColumn('pages', 'alias', $this->string()); |
|
16 | ||
17 | $this->createIndex( |
|
18 | 'idx-pages-alias', |
|
19 | 'pages', |
|
20 | 'alias' |
|
21 | ); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | */ |
|
27 | public function safeDown() |
|
28 | { |
|
29 | $this->dropIndex( |
|
30 | 'idx-pages-alias', |
|
31 | 'pages' |
|
32 | ); |
|
33 | ||
34 | $this->dropColumn('pages', 'alias'); |
|
35 | } |
|
36 | } |
|
37 |
@@ 8-36 (lines=29) @@ | ||
5 | /** |
|
6 | * Class m200609_141644_add_alias_to_products_table |
|
7 | */ |
|
8 | class m200609_141644_add_alias_to_products_table extends Migration |
|
9 | { |
|
10 | /** |
|
11 | * {@inheritdoc} |
|
12 | */ |
|
13 | public function safeUp() |
|
14 | { |
|
15 | $this->addColumn('products', 'alias', $this->string()); |
|
16 | ||
17 | $this->createIndex( |
|
18 | 'idx-products-alias', |
|
19 | 'products', |
|
20 | 'alias' |
|
21 | ); |
|
22 | } |
|
23 | ||
24 | /** |
|
25 | * {@inheritdoc} |
|
26 | */ |
|
27 | public function safeDown() |
|
28 | { |
|
29 | $this->dropIndex( |
|
30 | 'idx-products-alias', |
|
31 | 'products' |
|
32 | ); |
|
33 | ||
34 | $this->dropColumn('products', 'alias'); |
|
35 | } |
|
36 | } |
|
37 |