1 | <?php |
||
12 | class m5_add_cblocks_schema extends \phpbb\db\migration\migration |
||
13 | { |
||
14 | /** |
||
15 | * Skip this migration if the sm_cblocks table already exists |
||
16 | * |
||
17 | * @return bool True to skip this migration, false to run it |
||
18 | * @access public |
||
19 | */ |
||
20 | public function effectively_installed() |
||
21 | { |
||
22 | return $this->db_tools->sql_table_exists($this->table_prefix . 'sm_cblocks'); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @inheritdoc |
||
27 | */ |
||
28 | public static function depends_on() |
||
29 | { |
||
30 | return array( |
||
31 | '\blitze\sitemaker\migrations\v20x\m1_initial_schema', |
||
32 | ); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @inheritdoc |
||
37 | */ |
||
38 | public function update_schema() |
||
39 | { |
||
40 | return array( |
||
41 | 'add_tables' => array( |
||
42 | $this->table_prefix . 'sm_cblocks' => array( |
||
43 | 'COLUMNS' => array( |
||
44 | 'block_id' => array('UINT', null, 'auto_increment'), |
||
45 | 'block_content' => array('TEXT_UNI', ''), |
||
46 | 'bbcode_bitfield' => array('VCHAR:255', ''), |
||
47 | 'bbcode_options' => array('UINT:11', 7), |
||
48 | 'bbcode_uid' => array('VCHAR:8', ''), |
||
49 | ), |
||
50 | |||
51 | 'PRIMARY_KEY' => 'block_id' |
||
52 | ), |
||
53 | ), |
||
54 | ); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | public function revert_schema() |
||
61 | { |
||
62 | return array( |
||
63 | 'drop_tables' => array( |
||
64 | $this->table_prefix . 'sm_cblocks', |
||
65 | ), |
||
66 | ); |
||
67 | } |
||
68 | } |
||
69 |