@@ -10,7 +10,7 @@ |
||
10 | 10 | // created by an earlier cms migration so always appears if the |
11 | 11 | // migration creation order is not adhered to. |
12 | 12 | $connection = neon()->db; |
13 | -$sql =<<<EOQ |
|
13 | +$sql = <<<EOQ |
|
14 | 14 | SET foreign_key_checks = 0; |
15 | 15 | DROP TABLE IF EXISTS `ddt_cms_static_content`; |
16 | 16 | DELETE FROM `dds_member` WHERE `class_type`='cms_static_content'; |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | |
8 | 8 | class m170112_211700_change_dds_page_ids_to_uuid64 extends Migration |
9 | 9 | { |
10 | - public function safeUp() |
|
11 | - { |
|
12 | - $cms_page = CmsPage::tableName(); |
|
13 | - // Step 1 |
|
10 | + public function safeUp() |
|
11 | + { |
|
12 | + $cms_page = CmsPage::tableName(); |
|
13 | + // Step 1 |
|
14 | 14 | // ------ |
15 | - // loop through all members in the DDS and find all members with a definition using |
|
15 | + // loop through all members in the DDS and find all members with a definition using |
|
16 | 16 | // {class: neon\\cms\\form\\fields\\PageSelector} |
17 | 17 | // or where the definition uses a `dataMapKey` of `pages` and a `dataMapProvider` of `cms` |
18 | 18 | $members = neon()->db->query()->select('*')->from('dds_member')->where('definition LIKE \'{"class":"neon__cms__form__fields__PageSelector%\'')->all(); |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | $this->dropColumn($cms_page, 'old_id'); |
50 | - } |
|
50 | + } |
|
51 | 51 | |
52 | - public function safeDown() |
|
53 | - { |
|
54 | - echo "There is no coming back from this!\n"; |
|
55 | - } |
|
52 | + public function safeDown() |
|
53 | + { |
|
54 | + echo "There is no coming back from this!\n"; |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | \ No newline at end of file |
@@ -27,14 +27,14 @@ |
||
27 | 27 | // - note the `member_ref` as the $column in the ddt table - this column will hold the previous integer based page id |
28 | 28 | // which will match the cms_page.old_id column |
29 | 29 | foreach ($members as $member) { |
30 | - $class_type = $member['class_type']; |
|
31 | - $ddt_table_name = 'ddt_' . $class_type; |
|
30 | + $class_type = $member['class_type']; |
|
31 | + $ddt_table_name = 'ddt_'.$class_type; |
|
32 | 32 | $column = $member['member_ref']; |
33 | 33 | |
34 | 34 | // Step 3 |
35 | 35 | // ------ |
36 | 36 | // Alter the $column in $ddt_table_name to be a uuid64 (char(22)) |
37 | - $exists = $this->db->createCommand("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE `table_name` = '$ddt_table_name' AND `table_schema` = '". env('DB_NAME')."' AND column_name = '$column'")->queryScalar(); |
|
37 | + $exists = $this->db->createCommand("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE `table_name` = '$ddt_table_name' AND `table_schema` = '".env('DB_NAME')."' AND column_name = '$column'")->queryScalar(); |
|
38 | 38 | if ($exists) { |
39 | 39 | $this->alterColumn($ddt_table_name, $column, $this->char(22)->comment("A uuid using base 64")); |
40 | 40 | // Update the $column value in every row in the $ddt_table_name by matching it to the cms_page.old_id |
@@ -5,20 +5,20 @@ |
||
5 | 5 | class m161130_180814_cms_additional_page_fields extends Migration |
6 | 6 | { |
7 | 7 | |
8 | - public function safeUp() |
|
9 | - { |
|
8 | + public function safeUp() |
|
9 | + { |
|
10 | 10 | $this->addColumn('cms_page', 'keywords', "VARCHAR(1000) NULL COMMENT 'Keywords for this page'"); |
11 | 11 | $this->addColumn('cms_page', 'description', "VARCHAR(1000) NULL COMMENT 'Description of this page'"); |
12 | 12 | $this->addColumn('cms_page', 'languages', "VARCHAR(1000) NULL COMMENT 'Supported languages on this page'"); |
13 | 13 | $this->addColumn('cms_page', 'page_params', "VARCHAR(10000) NULL COMMENT 'Additional parameters for this page which are interpreted directly within the templates'"); |
14 | - } |
|
14 | + } |
|
15 | 15 | |
16 | - public function safeDown() |
|
17 | - { |
|
16 | + public function safeDown() |
|
17 | + { |
|
18 | 18 | $this->dropColumn('cms_page', 'keywords'); |
19 | 19 | $this->dropColumn('cms_page', 'description'); |
20 | 20 | $this->dropColumn('cms_page', 'languages'); |
21 | 21 | $this->dropColumn('cms_page', 'page_params'); |
22 | - } |
|
22 | + } |
|
23 | 23 | |
24 | 24 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | /** |
36 | 36 | * @inheritdoc |
37 | 37 | */ |
38 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
38 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
39 | 39 | { |
40 | 40 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
41 | 41 | if (!empty($searchData)) { |