| Total Complexity | 3 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class m9_update_menu_items_fields extends \phpbb\db\migration\migration |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @inheritdoc |
||
| 19 | */ |
||
| 20 | public static function depends_on() |
||
| 21 | { |
||
| 22 | return array( |
||
| 23 | '\blitze\sitemaker\migrations\converter\c4_convert_primetime_data', |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Update the sm_menu_items schema |
||
| 29 | * |
||
| 30 | * @return array Array of table schema |
||
| 31 | * @access public |
||
| 32 | */ |
||
| 33 | public function update_schema() |
||
| 34 | { |
||
| 35 | return array( |
||
| 36 | 'add_columns' => array( |
||
| 37 | $this->table_prefix . 'sm_menu_items' => array( |
||
| 38 | 'item_parents' => array('MTEXT', ''), |
||
| 39 | ), |
||
| 40 | ), |
||
| 41 | 'drop_columns' => array( |
||
| 42 | $this->table_prefix . 'sm_menu_items' => array( |
||
| 43 | 'item_desc', |
||
| 44 | 'group_id', |
||
| 45 | ), |
||
| 46 | ), |
||
| 47 | ); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Revert schema changes |
||
| 52 | * |
||
| 53 | * @return array Array of table schema |
||
| 54 | * @access public |
||
| 55 | */ |
||
| 56 | public function revert_schema() |
||
| 57 | { |
||
| 58 | return array( |
||
| 59 | 'drop_columns' => array( |
||
| 60 | $this->table_prefix . 'sm_menu_items' => array('item_parents'), |
||
| 61 | ), |
||
| 62 | 'add_columns' => array( |
||
| 63 | $this->table_prefix . 'sm_menu_items' => array( |
||
| 64 | 'group_id' => array('UINT', 0), |
||
| 65 | 'item_desc' => array('VCHAR:55', ''), |
||
| 66 | ), |
||
| 71 |