|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * |
| 4 | + * Pastebin extension for the phpBB Forum Software package. |
| 5 | + * |
| 6 | + * @copyright (c) 2024 Crizzo <https://www.phpBB.de> |
| 7 | + * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | + * |
| 9 | + */ |
| 10 | + |
| 11 | +namespace phpbbde\pastebin\migrations; |
| 12 | + |
| 13 | +class v210 extends \phpbb\db\migration\migration |
| 14 | +{ |
| 15 | + public static function depends_on() |
| 16 | + { |
| 17 | + return array( |
| 18 | + '\phpbbde\pastebin\migrations\v206', |
| 19 | + ); |
| 20 | + } |
| 21 | + /** |
| 22 | + * Add the pastebin lang schema to the database: |
| 23 | + * pastebin_langs: |
| 24 | + * lang_id |
| 25 | + * file_extension |
| 26 | + * lang_name |
| 27 | + * lang_active |
| 28 | + * |
| 29 | + * @return array Array of table schema |
| 30 | + * @access public |
| 31 | + */ |
| 32 | + public function update_schema() |
| 33 | + { |
| 34 | + return array( |
| 35 | + 'add_tables' => array( |
| 36 | + $this->table_prefix . 'pastebin_langs' => array( |
| 37 | + 'COLUMNS' => array( |
| 38 | + 'lang_id' => array('UINT', null, 'auto_increment'), |
| 39 | + 'lang_file_ext' => array('VCHAR:100', ''), |
| 40 | + 'lang_name' => array('VCHAR:100', ''), |
| 41 | + 'lang_active' => array('BOOL', 0), |
| 42 | + ), |
| 43 | + 'PRIMARY_KEY' => 'lang_id', |
| 44 | + ), |
| 45 | + ), |
| 46 | + ); |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * Drop the pastebin_langs table schema from the database |
| 51 | + * |
| 52 | + * @return array Array of table schema |
| 53 | + * @access public |
| 54 | + */ |
| 55 | + public function revert_schema() |
| 56 | + { |
| 57 | + return array( |
| 58 | + 'drop_tables' => array( |
| 59 | + $this->table_prefix . 'pastebin_langs', |
| 60 | + ), |
| 61 | + ); |
| 62 | + } |
| 63 | +} |
0 commit comments