| Total Complexity | 2 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class c3_update_tables extends \phpbb\db\migration\migration |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Skip this migration if a previous blocks table does not exist |
||
| 19 | * |
||
| 20 | * @return bool True to skip this migration, false to run it |
||
| 21 | * @access public |
||
| 22 | */ |
||
| 23 | public function effectively_installed() |
||
| 24 | { |
||
| 25 | return !$this->db_tools->sql_table_exists($this->table_prefix . 'blocks'); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Update the table name |
||
| 30 | * |
||
| 31 | * @return array Array of table schema |
||
| 32 | * @access public |
||
| 33 | */ |
||
| 34 | public function update_schema() |
||
| 35 | { |
||
| 36 | return array( |
||
| 37 | 'drop_tables' => array( |
||
| 38 | $this->table_prefix . 'blocks', |
||
| 39 | $this->table_prefix . 'blocks_config', |
||
| 40 | $this->table_prefix . 'block_positions', |
||
| 41 | ), |
||
| 42 | 'add_columns' => array( |
||
| 43 | $this->table_prefix . 'menu_items' => array( |
||
| 44 | 'depth' => array('UINT', 0), |
||
| 45 | ), |
||
| 46 | ), |
||
| 47 | 'drop_columns' => array( |
||
| 48 | $this->table_prefix . 'menus' => array('menu_type', 'menu_status'), |
||
| 49 | $this->table_prefix . 'menu_items' => array('item_expanded'), |
||
| 50 | $this->table_prefix . 'forums' => array('module'), |
||
| 51 | $this->table_prefix . 'users' => array('user_week_start'), |
||
| 52 | ), |
||
| 56 |