From da7fc9e5daf6e72f9b86dbc5e002febb202f516e Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 10 Jun 2015 15:11:27 +0200 Subject: [ticket/13935] Allow more admin-configurable schemes in post links PHPBB3-13935 --- .../migration/data/v320/allowed_schemes_links.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php new file mode 100644 index 0000000000..de127e3745 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php @@ -0,0 +1,24 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class allowed_schemes_links extends \phpbb\db\migration\migration +{ + public function update_data() + { + return array( + array('config.add', array('allowed_schemes_links', 'http,https,ftp')), + ); + } +} -- cgit v1.2.1 From df56b2ed364e24f803047c9f64d168432ba2680c Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Wed, 16 Jul 2014 18:30:27 +0200 Subject: [ticket/8708] Add f_announce_global permission PHPBB3-8708 --- .../data/v320/announce_global_permission.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/announce_global_permission.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php new file mode 100644 index 0000000000..fe30a1c1b8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php @@ -0,0 +1,41 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class announce_global_permission extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = 'f_announce_global'"; + $result = $this->db->sql_query($sql); + $auth_option_id = $this->db->sql_fetchfield('auth_option_id'); + $this->db->sql_freeresult($result); + + return $auth_option_id !== false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc2'); + } + + public function update_data() + { + return array( + array('permission.add', array('f_announce_global', false, 'f_announce')), + ); + } +} -- cgit v1.2.1 From 1f16704d347277ca1923bd2e532bc25bafacf51c Mon Sep 17 00:00:00 2001 From: n-aleha Date: Sat, 18 Jul 2015 02:12:12 +0300 Subject: [ticket/12505] Add migration PHPBB3-12505 --- .../migration/data/v320/remove_outdated_media.php | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php new file mode 100644 index 0000000000..b2a0a79187 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -0,0 +1,83 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class remove_outdated_media extends \phpbb\db\migration\migration +{ + protected $cat_id = array( + ATTACHMENT_CATEGORY_WM, + ATTACHMENT_CATEGORY_RM, + ATTACHMENT_CATEGORY_QUICKTIME, + ); + + public function update_data() + { + return array( + array('custom', array(array($this, 'change_extension_group'))), + ); + } + + public function change_extension_group() + { + // select group ids of outdated media + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('cat_id', $cat_id); + $result = $this->db->sql_query($sql); + + $group_ids = array(); + while ($group_id = (int) $this->db->sql_fetchfield('group_id')) + { + $group_ids[] = $group_id; + } + $this->db->sql_freeresult($result); + + // nothing to do, admin has removed all the outdated media extension groups + if (empty($group_ids)) + { + return true; + } + + // get the group id of downloadable files + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_name = 'DOWNLOADABLE_FILES'"; + $result = $this->db->sql_query($sql); + $download_id = (int) $this->db->sql_fetchfield('group_id'); + $this->db->sql_freeresult($result); + + if (empty($download_id)) + { + $sql = 'UPDATE ' . EXTENSIONS_TABLE . ' + SET group_id = 0 + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + } + else + { + // move outdated media extensions to downloadable files + $sql = 'UPDATE ' . EXTENSIONS_TABLE . " + SET group_id = $download_id" . ' + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + } + + $result = $this->db->sql_query($sql); + $this->db->sql_freeresult($result); + + // delete the now empty, outdated media extension groups + $sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + $result = $this->db->sql_query($sql); + $this->db->sql_freeresult($result); + } +} -- cgit v1.2.1 From afccb9cb49ce8e96079d3f0b1ea1f9084194a316 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Tue, 21 Jul 2015 00:42:34 +0300 Subject: [ticket/12505] Fix variable usage in migration file PHPBB3-12505 --- phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index b2a0a79187..59208be4dc 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -33,7 +33,7 @@ class remove_outdated_media extends \phpbb\db\migration\migration // select group ids of outdated media $sql = 'SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . ' - WHERE ' . $this->db->sql_in_set('cat_id', $cat_id); + WHERE ' . $this->db->sql_in_set('cat_id', $this->cat_id); $result = $this->db->sql_query($sql); $group_ids = array(); -- cgit v1.2.1 From 306fbf23a8113e6d9d7160e02889bd10ea24b495 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sun, 30 Aug 2015 16:22:26 +0200 Subject: [ticket/9485] Add a "View post" link in the moderation logs PHPBB3-9485 --- phpBB/phpbb/db/migration/data/v320/log_post_id.php | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/log_post_id.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/log_post_id.php b/phpBB/phpbb/db/migration/data/v320/log_post_id.php new file mode 100644 index 0000000000..0f155d543c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/log_post_id.php @@ -0,0 +1,44 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class log_post_id extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'log' => array( + 'post_id' => array('UINT', 0, 'after' => 'topic_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'log' => array( + 'post_id', + ), + ), + ); + } +} -- cgit v1.2.1 From 956723af0ed94f79dbbeed2bcfc8617b2c73960e Mon Sep 17 00:00:00 2001 From: Michael Miday Date: Tue, 15 Sep 2015 22:23:24 +0200 Subject: [ticket/12769] Properly include FA --- .../db/migration/data/v320/font_awesome_update.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/font_awesome_update.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php new file mode 100644 index 0000000000..6ffaf18b4a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class font_awesome_update extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['load_font_awesome_url']); + } + + public function update_data() + { + return array( + array('config.add', array('load_font_awesome_url', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css')), + ); + } +} -- cgit v1.2.1 From a7ba640ea778bf1936a035952f99b78497feef22 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 21 Sep 2015 10:46:48 +0200 Subject: [ticket/14182] Move v310\notifications_board migration to v320\... PHPBB3-14182 --- .../db/migration/data/v320/notifications_board.php | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/notifications_board.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php new file mode 100644 index 0000000000..fd9f1a2ad6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php @@ -0,0 +1,73 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class notifications_board extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications'); + } + + public function update_data() + { + return array( + array('config.add', array('allow_board_notifications', 1)), + array('custom', array(array($this, 'update_user_subscriptions'))), + array('custom', array(array($this, 'update_module'))), + ); + } + + public function update_module() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET auth = 'cfg_allow_board_notifications' + WHERE module_basename = 'ucp_notifications' + AND module_mode = 'notification_list'"; + $this->sql_query($sql); + } + + public function update_user_subscriptions() + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = 'notification.method.board' + WHERE method = ''"; + $this->sql_query($sql); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'revert_user_subscriptions'))), + array('custom', array(array($this, 'revert_module'))), + ); + } + + public function revert_user_subscriptions() + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = '' + WHERE method = 'notification.method.board'"; + $this->sql_query($sql); + } + + public function revert_module() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET auth = '' + WHERE module_basename = 'ucp_notifications' + AND module_mode = 'notification_list'"; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From 21201aa1ab6dd94534c6f87f235d312d07d1db24 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sun, 13 Sep 2015 14:43:50 +0200 Subject: [ticket/13101] Remove existing MSN/WLM custom profile field PHPBB3-13101 --- .../data/v320/remove_profilefield_wlm.php | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php new file mode 100644 index 0000000000..2898c708f8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php @@ -0,0 +1,150 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class remove_profilefield_wlm extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\profilefield_wlm'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_phpbb_wlm', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_phpbb_wlm' => array('VCHAR', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'delete_custom_profile_field_data'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + public function delete_custom_profile_field_data() + { + $field_id = $this->get_custom_profile_field_id(); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + } + + /** + * Get custom profile field id + * @return int custom profile filed id + */ + public function get_custom_profile_field_id() + { + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_name = 'phpbb_wlm'"; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + + return $field_id; + } + + public function create_custom_field() + { + $sql = 'SELECT MAX(field_order) as max_field_order + FROM ' . PROFILE_FIELDS_TABLE; + $result = $this->db->sql_query($sql); + $max_field_order = (int) $this->db->sql_fetchfield('max_field_order'); + $this->db->sql_freeresult($result); + + $sql_ary = array( + 'field_name' => 'phpbb_wlm', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_wlm', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => '', + 'field_contact_url' => '', + 'field_order' => $max_field_order + 1, + ); + + $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_nextid(); + + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + $lang_name = 'WLM'; + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $insert_buffer->insert(array( + 'field_id' => (int) $field_id, + 'lang_id' => (int) $lang_id, + 'lang_name' => $lang_name, + 'lang_explain' => '', + 'lang_default_value' => '', + )); + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } +} -- cgit v1.2.1 From 3937f1f4ae77b29faf69292783cc3ae267785ee4 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sat, 12 Sep 2015 00:53:33 +0200 Subject: [ticket/14157] Allow to set the alt/title attribute on post icons PHPBB3-14157 --- phpBB/phpbb/db/migration/data/v320/icons_alt.php | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/icons_alt.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/icons_alt.php b/phpBB/phpbb/db/migration/data/v320/icons_alt.php new file mode 100644 index 0000000000..7071ae78db --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/icons_alt.php @@ -0,0 +1,44 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class icons_alt extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'icons' => array( + 'icons_alt' => array('VCHAR', '', 'after' => 'icons_height'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'icons' => array( + 'icons_alt', + ), + ), + ); + } +} -- cgit v1.2.1 From 33500fd3728f6e3444d5479b09b941b2570ff47c Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 25 Oct 2015 02:07:40 +0100 Subject: [ticket/14257] Use migrations instead of cron job for some reparsers PHPBB3-14257 --- .../phpbb/db/migration/data/v320/reparse_fast.php | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/reparse_fast.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/reparse_fast.php b/phpBB/phpbb/db/migration/data/v320/reparse_fast.php new file mode 100644 index 0000000000..ddb11f7f67 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/reparse_fast.php @@ -0,0 +1,87 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v320; + +class reparse_fast extends \phpbb\db\migration\container_aware_migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\contact_admin_form'); + } + + public function effectively_installed() + { + return isset($this->config['reparse_lock']); + } + + public function update_data() + { + return array( + array('config.add', array('reparse_lock', 0, true)), + array('custom', array(array($this, 'reparse'))), + ); + } + + public function reparse($resume_data) + { + // Somtimes a cron job is too much + $limit = 200; + $fast_reparsers = array( + 'text_reparser.contact_admin_info', + 'text_reparser.forum_description', + 'text_reparser.forum_rules', + 'text_reparser.group_description', + ); + + if (!is_array($resume_data)) + { + $resume_data = array( + 'reparser' => 0, + 'current' => $this->container->get($fast_reparsers[0])->get_max_id(), + ); + } + + $fast_reparsers_size = sizeof($fast_reparsers); + $processed_records = 0; + while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) + { + $reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]); + + // New reparser + if ($resume_data['current'] === 0) + { + $resume_data['current'] = $reparser->get_max_id(); + } + + $start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records)); + $end = max(1, $resume_data['current']); + $reparser->reparse_range($start, $end); + + $processed_records = $end - $start + 1; + $resume_data['current'] = $start - 1; + + if ($start === 1) + { + $resume_data['reparser']++; + } + } + + if ($resume_data['reparser'] === $fast_reparsers_size) + { + return true; + } + + return $resume_data; + } +} -- cgit v1.2.1 From 25e2b17837f5b1c2330d07a86f88b25bb55d96c1 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 26 Oct 2015 01:39:52 +0100 Subject: [ticket/14257] Add text_reparser manager PHPBB3-14257 --- .../phpbb/db/migration/data/v320/reparse_fast.php | 87 ------------------ .../phpbb/db/migration/data/v320/text_reparser.php | 101 +++++++++++++++++++++ 2 files changed, 101 insertions(+), 87 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v320/reparse_fast.php create mode 100644 phpBB/phpbb/db/migration/data/v320/text_reparser.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/reparse_fast.php b/phpBB/phpbb/db/migration/data/v320/reparse_fast.php deleted file mode 100644 index ddb11f7f67..0000000000 --- a/phpBB/phpbb/db/migration/data/v320/reparse_fast.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @license GNU General Public License, version 2 (GPL-2.0) - * - * For full copyright and license information, please see - * the docs/CREDITS.txt file. - * - */ - -namespace phpbb\db\migration\data\v320; - -class reparse_fast extends \phpbb\db\migration\container_aware_migration -{ - static public function depends_on() - { - return array('\phpbb\db\migration\data\v310\contact_admin_form'); - } - - public function effectively_installed() - { - return isset($this->config['reparse_lock']); - } - - public function update_data() - { - return array( - array('config.add', array('reparse_lock', 0, true)), - array('custom', array(array($this, 'reparse'))), - ); - } - - public function reparse($resume_data) - { - // Somtimes a cron job is too much - $limit = 200; - $fast_reparsers = array( - 'text_reparser.contact_admin_info', - 'text_reparser.forum_description', - 'text_reparser.forum_rules', - 'text_reparser.group_description', - ); - - if (!is_array($resume_data)) - { - $resume_data = array( - 'reparser' => 0, - 'current' => $this->container->get($fast_reparsers[0])->get_max_id(), - ); - } - - $fast_reparsers_size = sizeof($fast_reparsers); - $processed_records = 0; - while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) - { - $reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]); - - // New reparser - if ($resume_data['current'] === 0) - { - $resume_data['current'] = $reparser->get_max_id(); - } - - $start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records)); - $end = max(1, $resume_data['current']); - $reparser->reparse_range($start, $end); - - $processed_records = $end - $start + 1; - $resume_data['current'] = $start - 1; - - if ($start === 1) - { - $resume_data['reparser']++; - } - } - - if ($resume_data['reparser'] === $fast_reparsers_size) - { - return true; - } - - return $resume_data; - } -} diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php new file mode 100644 index 0000000000..0d8fd2ebb5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -0,0 +1,101 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v320; + +class text_reparser extends \phpbb\db\migration\container_aware_migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\contact_admin_form'); + } + + public function effectively_installed() + { + return isset($this->config['reparse_lock']); + } + + public function update_data() + { + return array( + array('config.add', array('reparse_lock', 0, true)), + array('config.add', array('text_reparser.pm_text_cron_interval', 0)), + array('config.add', array('text_reparser.pm_text_last_cron', 0)), + array('config.add', array('text_reparser.poll_option_cron_interval', 0)), + array('config.add', array('text_reparser.poll_option_last_cron', 0)), + array('config.add', array('text_reparser.poll_title_cron_interval', 0)), + array('config.add', array('text_reparser.poll_title_last_cron', 0)), + array('config.add', array('text_reparser.post_text_cron_interval', 0)), + array('config.add', array('text_reparser.post_text_last_cron', 0)), + array('config.add', array('text_reparser.user_signature_cron_interval', 0)), + array('config.add', array('text_reparser.user_signature_last_cron', 0)), + array('custom', array(array($this, 'reparse'))), + ); + } + + public function reparse($resume_data) + { + // Somtimes a cron job is too much + $limit = 100; + $fast_reparsers = array( + 'text_reparser.contact_admin_info', + 'text_reparser.forum_description', + 'text_reparser.forum_rules', + 'text_reparser.group_description', + ); + + if (!is_array($resume_data)) + { + $resume_data = array( + 'reparser' => 0, + 'current' => $this->container->get($fast_reparsers[0])->get_max_id(), + ); + } + + $fast_reparsers_size = sizeof($fast_reparsers); + $processed_records = 0; + while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) + { + $reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]); + + // New reparser + if ($resume_data['current'] === 0) + { + $resume_data['current'] = $reparser->get_max_id(); + } + + $start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records)); + $end = max(1, $resume_data['current']); + $reparser->reparse_range($start, $end); + + $processed_records = $end - $start + 1; + $resume_data['current'] = $start - 1; + + if ($start === 1) + { + // Prevent CLI command from running these reparsers again + $reparser_manager = $this->container->get('text_reparser.manager'); + $reparser_manager->update_resume_data($fast_reparsers[$resume_data['reparser']], 1, 0, $limit); + + $resume_data['reparser']++; + } + } + + if ($resume_data['reparser'] === $fast_reparsers_size) + { + return true; + } + + return $resume_data; + } +} -- cgit v1.2.1 From 900ccd79af816d8d54e6974e9163d9999a823513 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 1 Nov 2015 03:49:01 +0100 Subject: [ticket/14257] Fix CLI reparser and set cron interval PHPBB3-14257 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 0d8fd2ebb5..1d73b74a76 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -29,15 +29,15 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration { return array( array('config.add', array('reparse_lock', 0, true)), - array('config.add', array('text_reparser.pm_text_cron_interval', 0)), + array('config.add', array('text_reparser.pm_text_cron_interval', 10)), array('config.add', array('text_reparser.pm_text_last_cron', 0)), - array('config.add', array('text_reparser.poll_option_cron_interval', 0)), + array('config.add', array('text_reparser.poll_option_cron_interval', 10)), array('config.add', array('text_reparser.poll_option_last_cron', 0)), - array('config.add', array('text_reparser.poll_title_cron_interval', 0)), + array('config.add', array('text_reparser.poll_title_cron_interval', 10)), array('config.add', array('text_reparser.poll_title_last_cron', 0)), - array('config.add', array('text_reparser.post_text_cron_interval', 0)), + array('config.add', array('text_reparser.post_text_cron_interval', 10)), array('config.add', array('text_reparser.post_text_last_cron', 0)), - array('config.add', array('text_reparser.user_signature_cron_interval', 0)), + array('config.add', array('text_reparser.user_signature_cron_interval', 10)), array('config.add', array('text_reparser.user_signature_last_cron', 0)), array('custom', array(array($this, 'reparse'))), ); -- cgit v1.2.1 From 2144f35e9daf17d69f040082fd236c80bb71d04f Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 15 Oct 2015 10:57:46 +0200 Subject: [prep-release-3.2.0-a1] Add migration for 3.2.0-a1 --- .../migration/data/v320/allowed_schemes_links.php | 7 ++++ .../data/v320/announce_global_permission.php | 4 +- phpBB/phpbb/db/migration/data/v320/dev.php | 36 ++++++++++++++++++ .../db/migration/data/v320/font_awesome_update.php | 7 ++++ phpBB/phpbb/db/migration/data/v320/icons_alt.php | 4 +- phpBB/phpbb/db/migration/data/v320/log_post_id.php | 4 +- .../db/migration/data/v320/notifications_board.php | 4 +- .../migration/data/v320/remove_outdated_media.php | 7 ++++ .../data/v320/remove_profilefield_wlm.php | 4 +- phpBB/phpbb/db/migration/data/v320/v320a1.php | 44 ++++++++++++++++++++++ 10 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v320/dev.php create mode 100644 phpBB/phpbb/db/migration/data/v320/v320a1.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php index de127e3745..726822bc71 100644 --- a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php +++ b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php @@ -15,6 +15,13 @@ namespace phpbb\db\migration\data\v320; class allowed_schemes_links extends \phpbb\db\migration\migration { + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + ); + } + public function update_data() { return array( diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php index fe30a1c1b8..7afecb884b 100644 --- a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php +++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php @@ -29,7 +29,9 @@ class announce_global_permission extends \phpbb\db\migration\migration static public function depends_on() { - return array('\phpbb\db\migration\data\v310\rc2'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v320/dev.php b/phpBB/phpbb/db/migration/data/v320/dev.php new file mode 100644 index 0000000000..ad2da3c1f4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/dev.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class dev extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-dev', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v316', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-dev')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php index 6ffaf18b4a..817b638037 100644 --- a/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php +++ b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php @@ -15,6 +15,13 @@ namespace phpbb\db\migration\data\v320; class font_awesome_update extends \phpbb\db\migration\migration { + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + ); + } + public function effectively_installed() { return isset($this->config['load_font_awesome_url']); diff --git a/phpBB/phpbb/db/migration/data/v320/icons_alt.php b/phpBB/phpbb/db/migration/data/v320/icons_alt.php index 7071ae78db..80132e579e 100644 --- a/phpBB/phpbb/db/migration/data/v320/icons_alt.php +++ b/phpBB/phpbb/db/migration/data/v320/icons_alt.php @@ -17,7 +17,9 @@ class icons_alt extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\dev'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v320/log_post_id.php b/phpBB/phpbb/db/migration/data/v320/log_post_id.php index 0f155d543c..ead53c8138 100644 --- a/phpBB/phpbb/db/migration/data/v320/log_post_id.php +++ b/phpBB/phpbb/db/migration/data/v320/log_post_id.php @@ -17,7 +17,9 @@ class log_post_id extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\dev'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php index fd9f1a2ad6..8a76ebab58 100644 --- a/phpBB/phpbb/db/migration/data/v320/notifications_board.php +++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php @@ -17,7 +17,9 @@ class notifications_board extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\notifications'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index 59208be4dc..c14d31f1c0 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -21,6 +21,13 @@ class remove_outdated_media extends \phpbb\db\migration\migration ATTACHMENT_CATEGORY_QUICKTIME, ); + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + ); + } + public function update_data() { return array( diff --git a/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php index 2898c708f8..1cb9070bf9 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php @@ -17,7 +17,9 @@ class remove_profilefield_wlm extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\profilefield_wlm'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v320/v320a1.php b/phpBB/phpbb/db/migration/data/v320/v320a1.php new file mode 100644 index 0000000000..d7ecb36f90 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320a1.php @@ -0,0 +1,44 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class v320a1 extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-a1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + '\phpbb\db\migration\data\v320\allowed_schemes_links', + '\phpbb\db\migration\data\v320\announce_global_permission', + '\phpbb\db\migration\data\v320\remove_profilefield_wlm', + '\phpbb\db\migration\data\v320\font_awesome_update', + '\phpbb\db\migration\data\v320\icons_alt', + '\phpbb\db\migration\data\v320\log_post_id', + '\phpbb\db\migration\data\v320\remove_outdated_media', + '\phpbb\db\migration\data\v320\notifications_board', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-dev')), + ); + } +} -- cgit v1.2.1 From 8daeb6962aa0f86798e40ae94c59fac9184155c0 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 14 Dec 2015 22:39:10 +0100 Subject: [prep-release-3.2.0-a2] Add migration for 3.2.0-a2 --- phpBB/phpbb/db/migration/data/v320/v320a2.php | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320a2.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/v320a2.php b/phpBB/phpbb/db/migration/data/v320/v320a2.php new file mode 100644 index 0000000000..ae53a73210 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320a2.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class v320a2 extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-a2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317rc1', + '\phpbb\db\migration\data\v320\text_reparser', + '\phpbb\db\migration\data\v320\v320a1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-a2')), + ); + } +} -- cgit v1.2.1 From 8ed59fb82a9381914a4ccce91c0c5fac44616556 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 23 Oct 2015 02:44:41 +0200 Subject: [ticket/14250] Change token_storage class to fit changed interface PHPBB3-14250 --- .../phpbb/db/migration/data/v320/oauth_states.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/oauth_states.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/oauth_states.php b/phpBB/phpbb/db/migration/data/v320/oauth_states.php new file mode 100644 index 0000000000..22ab2dabb3 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/oauth_states.php @@ -0,0 +1,56 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class oauth_states extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\auth_provider_oauth'); + } + + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'oauth_states'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'oauth_states' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'session_id' => array('CHAR:32', ''), + 'provider' => array('VCHAR', ''), + 'oauth_state' => array('VCHAR', ''), + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'provider' => array('INDEX', 'provider'), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'oauth_states', + ), + ); + } +} -- cgit v1.2.1 From 31607771e1cbb17d4bf841fd93e7f699427b8814 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Jan 2016 17:02:42 +0100 Subject: [ticket/11875] Add migration file PHPBB3-11875 --- .../migration/data/v320/default_data_type_ids.php | 252 +++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php new file mode 100644 index 0000000000..5fbf343bfb --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php @@ -0,0 +1,252 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class default_data_type_ids extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v320\v320a2'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'attachments' => array( + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'bookmarks' => array( + 'topic_id' => array('ULINT', 0), + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'bots' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'drafts' => array( + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'forums_access' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'forums_track' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'forums_watch' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'log' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'login_attempts' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'moderator_cache' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'notifications' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'oauth_tokens' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'poll_options' => array( + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'poll_votes' => array( + 'topicr_id' => array('ULINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_id' => array('ULINT', null, 'auto_increment'), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs_folder' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs_rules' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs_to' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'profile_fields_data' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'reports' => array( + 'post_id' => array('ULINT', 0), + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'search_wordmatch' => array( + 'post_id' => array('ULINT', 0), + ), + $this->table_prefix . 'sessions_keys' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_id' => array('ULINT', null, 'auto_increment'), + ), + $this->table_prefix . 'topics_track' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'topics_posted' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'topics_watch' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'user_notifications' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'user_group' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_id' => array('ULINT', null, 'auto_increment'), + ), + $this->table_prefix . 'warnings' => array( + 'user_id' => array('ULINT', 0), + 'post_Id' => array('ULINT', 0), + ), + $this->table_prefix . 'zebra' => array( + 'user_id' => array('ULINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'attachments' => array( + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'bookmarks' => array( + 'topic_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'bots' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'drafts' => array( + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums_access' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums_track' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums_watch' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'log' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'login_attempts' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'moderator_cache' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'notifications' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'oauth_tokens' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'poll_options' => array( + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'poll_votes' => array( + 'topicr_id' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_id' => array('UINT', null, 'auto_increment'), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs_folder' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs_rules' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs_to' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'profile_fields_data' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'reports' => array( + 'post_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'search_wordmatch' => array( + 'post_id' => array('UINT', 0), + ), + $this->table_prefix . 'sessions_keys' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_id' => array('UINT', null, 'auto_increment'), + ), + $this->table_prefix . 'topics_track' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'topics_posted' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'topics_watch' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'user_notifications' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'user_group' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_id' => array('UINT', null, 'auto_increment'), + ), + $this->table_prefix . 'warnings' => array( + 'user_id' => array('UINT', 0), + 'post_Id' => array('UINT', 0), + ), + $this->table_prefix . 'zebra' => array( + 'user_id' => array('UINT', 0), + ), + ), + ); + } +} -- cgit v1.2.1 From 7cd7bb3c015be1355ab634d3cb704c1d764bf8b0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Jan 2016 19:35:04 +0100 Subject: [ticket/11875] Change more columns to use UINT and add missings ones PHPBB3-11875 --- .../migration/data/v320/default_data_type_ids.php | 134 ++++++++++++++++++--- 1 file changed, 120 insertions(+), 14 deletions(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php index 5fbf343bfb..ecee09ce77 100644 --- a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php +++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php @@ -24,22 +24,36 @@ class default_data_type_ids extends \phpbb\db\migration\migration { return array( 'change_columns' => array( + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('ULINT', 0), + ), $this->table_prefix . 'attachments' => array( + 'attach_id' => array('ULINT', null, 'auto_increment'), + 'post_msg_id' => array('ULINT', 0), + 'poster_id' => array('ULINT', 0), 'topic_id' => array('ULINT', 0), ), - $this->table_prefix . 'acl_users' => array( - 'user_id' => array('ULINT', 0), + $this->table_prefix . 'banlist' => array( + 'ban_id' => array('ULINT', null, 'auto_increment'), + 'ban_userid' => array('ULINT', 0), ), $this->table_prefix . 'bookmarks' => array( 'topic_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'bots' => array( + 'bot_id' => array('ULINT', null, 'auto_increment'), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'drafts' => array( + 'draft_id' => array('ULINT', null, 'auto_increment'), + 'user_id' => array('ULINT', 0), 'topic_id' => array('ULINT', 0), ), + $this->table_prefix . 'forums' => array( + 'forum_last_post_id' => array('ULINT', 0), + 'forum_last_poster_id' => array('ULINT', 0), + ), $this->table_prefix . 'forums_access' => array( 'user_id' => array('ULINT', 0), ), @@ -50,6 +64,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'log' => array( + 'log_id' => array('ULINT', null, 'auto_increment'), + 'post_id' => array('ULINT', 0), + 'reportee_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), 'topic_id' => array('ULINT', 0), ), @@ -65,6 +82,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration $this->table_prefix . 'oauth_accounts' => array( 'user_id' => array('ULINT', 0), ), + $this->table_prefix . 'oauth_states' => array( + 'user_id' => array('ULINT', 0), + ), $this->table_prefix . 'oauth_tokens' => array( 'user_id' => array('ULINT', 0), ), @@ -72,36 +92,63 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('ULINT', 0), ), $this->table_prefix . 'poll_votes' => array( - 'topicr_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + 'vote_user_id' => array('ULINT', 0), ), $this->table_prefix . 'posts' => array( - 'post_id' => array('ULINT', null, 'auto_increment'), - 'topic_id' => array('ULINT', 0), + 'post_id' => array('ULINT', null, 'auto_increment'), + 'poster_id' => array('ULINT', 0), + 'post_delete_user' => array('ULINT', 0), + 'post_edit_user' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs' => array( + 'author_id' => array('ULINT', 0), + 'message_edit_user' => array('ULINT', 0), + 'msg_id' => array('ULINT', null, 'auto_increment'), ), $this->table_prefix . 'privmsgs_folder' => array( 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'privmsgs_rules' => array( + 'rule_user_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'privmsgs_to' => array( + 'author_id' => array('ULINT', 0), + 'msg_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'profile_fields_data' => array( 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'reports' => array( + 'report_id' => array('ULINT', 0), + 'pm_id' => array('ULINT', 0), 'post_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), + $this->table_prefix . 'search_wordlist' => array( + 'word_id' => array('ULINT', null, 'auto_increment'), + ), $this->table_prefix . 'search_wordmatch' => array( 'post_id' => array('ULINT', 0), + 'word_id' => array('ULINT', 0), + ), + $this->table_prefix . 'sessions' => array( + 'session_user_id' => array('ULINT', 0), ), $this->table_prefix . 'sessions_keys' => array( 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'topics' => array( - 'topic_id' => array('ULINT', null, 'auto_increment'), + 'topic_id' => array('ULINT', null, 'auto_increment'), + 'topic_poster' => array('ULINT', 0), + 'topic_first_post_id' => array('ULINT', 0), + 'topic_last_post_id' => array('ULINT', 0), + 'topic_last_poster_id' => array('ULINT', 0), + 'topic_moved_id' => array('ULINT', 0), + 'topic_delete_user' => array('ULINT', 0), ), $this->table_prefix . 'topics_track' => array( 'user_id' => array('ULINT', 0), @@ -116,6 +163,7 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('ULINT', 0), ), $this->table_prefix . 'user_notifications' => array( + 'item_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'user_group' => array( @@ -125,11 +173,16 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('ULINT', null, 'auto_increment'), ), $this->table_prefix . 'warnings' => array( + 'log_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), - 'post_Id' => array('ULINT', 0), + 'post_id' => array('ULINT', 0), + ), + $this->table_prefix . 'words' => array( + 'word_id' => array('ULINT', null, 'auto_increment'), ), $this->table_prefix . 'zebra' => array( 'user_id' => array('ULINT', 0), + 'zebra_id' => array('ULINT', 0), ), ), ); @@ -139,22 +192,36 @@ class default_data_type_ids extends \phpbb\db\migration\migration { return array( 'change_columns' => array( + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('UINT', 0), + ), $this->table_prefix . 'attachments' => array( + 'attach_id' => array('UINT', null, 'auto_increment'), + 'post_msg_id' => array('UINT', 0), + 'poster_id' => array('UINT', 0), 'topic_id' => array('UINT', 0), ), - $this->table_prefix . 'acl_users' => array( - 'user_id' => array('UINT', 0), + $this->table_prefix . 'banlist' => array( + 'ban_id' => array('UINT', null, 'auto_increment'), + 'ban_userid' => array('UINT', 0), ), $this->table_prefix . 'bookmarks' => array( 'topic_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'bots' => array( + 'bot_id' => array('UINT', null, 'auto_increment'), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'drafts' => array( + 'draft_id' => array('UINT', null, 'auto_increment'), + 'user_id' => array('UINT', 0), 'topic_id' => array('UINT', 0), ), + $this->table_prefix . 'forums' => array( + 'forum_last_post_id' => array('UINT', 0), + 'forum_last_poster_id' => array('UINT', 0), + ), $this->table_prefix . 'forums_access' => array( 'user_id' => array('UINT', 0), ), @@ -165,6 +232,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('UINT', 0), ), $this->table_prefix . 'log' => array( + 'log_id' => array('UINT', null, 'auto_increment'), + 'post_id' => array('UINT', 0), + 'reportee_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'topic_id' => array('UINT', 0), ), @@ -180,6 +250,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration $this->table_prefix . 'oauth_accounts' => array( 'user_id' => array('UINT', 0), ), + $this->table_prefix . 'oauth_states' => array( + 'user_id' => array('UINT', 0), + ), $this->table_prefix . 'oauth_tokens' => array( 'user_id' => array('UINT', 0), ), @@ -187,36 +260,63 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('UINT', 0), ), $this->table_prefix . 'poll_votes' => array( - 'topicr_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'vote_user_id' => array('UINT', 0), ), $this->table_prefix . 'posts' => array( - 'post_id' => array('UINT', null, 'auto_increment'), - 'topic_id' => array('UINT', 0), + 'post_id' => array('UINT', null, 'auto_increment'), + 'poster_id' => array('UINT', 0), + 'post_delete_user' => array('UINT', 0), + 'post_edit_user' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs' => array( + 'author_id' => array('UINT', 0), + 'message_edit_user' => array('UINT', 0), + 'msg_id' => array('UINT', null, 'auto_increment'), ), $this->table_prefix . 'privmsgs_folder' => array( 'user_id' => array('UINT', 0), ), $this->table_prefix . 'privmsgs_rules' => array( + 'rule_user_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'privmsgs_to' => array( + 'author_id' => array('UINT', 0), + 'msg_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'profile_fields_data' => array( 'user_id' => array('UINT', 0), ), $this->table_prefix . 'reports' => array( + 'report_id' => array('UINT', 0), + 'pm_id' => array('UINT', 0), 'post_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), + $this->table_prefix . 'search_wordlist' => array( + 'word_id' => array('UINT', null, 'auto_increment'), + ), $this->table_prefix . 'search_wordmatch' => array( 'post_id' => array('UINT', 0), + 'word_id' => array('UINT', 0), + ), + $this->table_prefix . 'sessions' => array( + 'session_user_id' => array('UINT', 0), ), $this->table_prefix . 'sessions_keys' => array( 'user_id' => array('UINT', 0), ), $this->table_prefix . 'topics' => array( - 'topic_id' => array('UINT', null, 'auto_increment'), + 'topic_id' => array('UINT', null, 'auto_increment'), + 'topic_poster' => array('UINT', 0), + 'topic_first_post_id' => array('UINT', 0), + 'topic_last_post_id' => array('UINT', 0), + 'topic_last_poster_id' => array('UINT', 0), + 'topic_moved_id' => array('UINT', 0), + 'topic_delete_user' => array('UINT', 0), ), $this->table_prefix . 'topics_track' => array( 'user_id' => array('UINT', 0), @@ -231,6 +331,7 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('UINT', 0), ), $this->table_prefix . 'user_notifications' => array( + 'item_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'user_group' => array( @@ -240,11 +341,16 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('UINT', null, 'auto_increment'), ), $this->table_prefix . 'warnings' => array( + 'log_id' => array('UINT', 0), 'user_id' => array('UINT', 0), - 'post_Id' => array('UINT', 0), + 'post_id' => array('UINT', 0), + ), + $this->table_prefix . 'words' => array( + 'word_id' => array('UINT', null, 'auto_increment'), ), $this->table_prefix . 'zebra' => array( 'user_id' => array('UINT', 0), + 'zebra_id' => array('UINT', 0), ), ), ); -- cgit v1.2.1 From daa92f7996f7026a12a5224a89297c9716d658a4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 27 Jan 2016 16:51:34 +0100 Subject: [ticket/14436] Add dependency on oauth_states migration PHPBB3-14436 --- phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php index ecee09ce77..65e5b3fa73 100644 --- a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php +++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php @@ -17,7 +17,10 @@ class default_data_type_ids extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v320\v320a2'); + return array( + '\phpbb\db\migration\data\v320\v320a2', + '\phpbb\db\migration\data\v320\oauth_states', + ); } public function update_schema() -- cgit v1.2.1 From fd9c05309d186332728b533467aaecad5c543c52 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 4 Feb 2016 17:10:59 +0100 Subject: [ticket/14448] Let user decide if remote upload certs should be checked Also fixed some minor issues like coding style. PHPBB3-14448 --- .../data/v320/remote_upload_validation.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php b/phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php new file mode 100644 index 0000000000..d61f6b96fd --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class remote_upload_validation extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320a2', + ); + } + + public function update_data() + { + return array( + array('config.add', array('remote_upload_verify', '0')), + ); + } +} -- cgit v1.2.1 From 379634a102877ceebadf18b16d449899ddb9aa73 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 3 Feb 2016 22:22:30 +0100 Subject: [prep-release-3.2.0-b1] Add migration for 3.2.0-b1 --- phpBB/phpbb/db/migration/data/v320/v320b1.php | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320b1.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/v320b1.php b/phpBB/phpbb/db/migration/data/v320/v320b1.php new file mode 100644 index 0000000000..5c3a3797cd --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320b1.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class v320b1 extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-b1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317pl1', + '\phpbb\db\migration\data\v320\v320a2', + '\phpbb\db\migration\data\v31x\increase_size_of_dateformat', + '\phpbb\db\migration\data\v320\default_data_type_ids', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-b1')), + ); + } +} -- cgit v1.2.1 From b40f9ce6e1df58f80d5e8878c9ff47178862d443 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 5 Feb 2016 11:58:51 +0100 Subject: [ticket/14453] Add missing dependency in the text_reparser migration PHPBB3-14453 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 1d73b74a76..8673a3488a 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -17,7 +17,10 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\contact_admin_form'); + return array( + '\phpbb\db\migration\data\v310\contact_admin_form', + '\phpbb\db\migration\data\v320\allowed_schemes_links', + ); } public function effectively_installed() -- cgit v1.2.1 From da08a6e3cbda3cb51052bd9c8b7ac697fba2305d Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sat, 6 Feb 2016 14:43:14 +0100 Subject: [ticket/14461] Correctly count up $processed_records PHPBB3-14461 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 8673a3488a..ea614feb40 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -81,7 +81,7 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration $end = max(1, $resume_data['current']); $reparser->reparse_range($start, $end); - $processed_records = $end - $start + 1; + $processed_records += $end - $start + 1; $resume_data['current'] = $start - 1; if ($start === 1) -- cgit v1.2.1 From 517c1f88259e0d30ed787bd762dcbab0c3e692f2 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 2 Mar 2016 22:19:25 +0100 Subject: [prep-release-3.2.0-b2] Add migration for 3.2.0-b2 --- phpBB/phpbb/db/migration/data/v320/v320b2.php | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320b2.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/v320b2.php b/phpBB/phpbb/db/migration/data/v320/v320b2.php new file mode 100644 index 0000000000..007f7588e6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320b2.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320b2 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-b2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v318', + '\phpbb\db\migration\data\v320\v320b1', + '\phpbb\db\migration\data\v320\remote_upload_validation', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-b2')), + ); + } +} -- cgit v1.2.1 From 933938a1d8452f2aa1ac833ab00db58aac67a8e6 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Fri, 18 Mar 2016 10:34:32 +0100 Subject: [ticket/14318] Fix SQL error in Notifications Board migration PHPBB3-14318 --- phpBB/phpbb/db/migration/data/v320/notifications_board.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php index 8a76ebab58..ac1b3a0f2c 100644 --- a/phpBB/phpbb/db/migration/data/v320/notifications_board.php +++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php @@ -34,7 +34,7 @@ class notifications_board extends \phpbb\db\migration\migration public function update_module() { $sql = 'UPDATE ' . MODULES_TABLE . " - SET auth = 'cfg_allow_board_notifications' + SET module_auth = 'cfg_allow_board_notifications' WHERE module_basename = 'ucp_notifications' AND module_mode = 'notification_list'"; $this->sql_query($sql); -- cgit v1.2.1 From 6eda942a7f3b605b41d3a8809939ff28abdc18b1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 1 May 2016 17:29:10 +0200 Subject: [ticket/14607] Add missing auto_increment to report_id PHPBB3-14607 --- .../data/v320/report_id_auto_increment.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php new file mode 100644 index 0000000000..c40504051e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php @@ -0,0 +1,45 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class report_id_auto_increment extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\default_data_type_ids', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'reports' => array( + 'report_id' => array('ULINT', null, 'auto_increment'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'reports' => array( + 'report_id' => array('ULINT', 0), 0), + ), + ); + } +} -- cgit v1.2.1 From a90d8fa8d475010c45b1bca1fd9c279a9eb42fac Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 8 Jun 2016 08:38:55 +0200 Subject: [ticket/14665] Remove invalid syntax in report_id_auto_increment migration PHPBB3-14665 --- phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php index c40504051e..6e81baefb9 100644 --- a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php +++ b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php @@ -38,8 +38,9 @@ class report_id_auto_increment extends \phpbb\db\migration\migration return array( 'change_columns' => array( $this->table_prefix . 'reports' => array( - 'report_id' => array('ULINT', 0), 0), + 'report_id' => array('ULINT', 0), ), + ), ); } } -- cgit v1.2.1 From 7cbb049572de066a8d9214b78a8c523f50d7014c Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 29 Apr 2016 20:25:19 +0200 Subject: [prep-release-3.2.0-RC1] Add migration --- phpBB/phpbb/db/migration/data/v320/v320rc1.php | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320rc1.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/v320rc1.php b/phpBB/phpbb/db/migration/data/v320/v320rc1.php new file mode 100644 index 0000000000..a04a2abb19 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320rc1.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320rc1 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v319', + '\phpbb\db\migration\data\v320\report_id_auto_increment', + '\phpbb\db\migration\data\v320\v320b2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-RC1')), + ); + } +} -- cgit v1.2.1 From d90afa67d866e1be44d3a69c97497c8412695f8d Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 9 Oct 2016 21:37:30 +0200 Subject: [ticket/14814] Fix reparser cron PHPBB3-14814 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index ea614feb40..03c5d39fe4 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -13,6 +13,9 @@ namespace phpbb\db\migration\data\v320; +use phpbb\textreparser\manager; +use phpbb\textreparser\reparser_interface; + class text_reparser extends \phpbb\db\migration\container_aware_migration { static public function depends_on() @@ -48,7 +51,19 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration public function reparse($resume_data) { - // Somtimes a cron job is too much + /** @var manager $reparser_manager */ + $reparser_manager = $this->container->get('text_reparser.manager'); + + /** @var reparser_interface[] $reparsers */ + $reparsers = $this->container->get('text_reparser_collection'); + + // Initialize all reparsers + foreach ($reparsers as $name => $reparser) + { + $reparser_manager->update_resume_data($name, 1, $reparser->get_max_id(), 100); + } + + // Sometimes a cron job is too much $limit = 100; $fast_reparsers = array( 'text_reparser.contact_admin_info', @@ -65,7 +80,7 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration ); } - $fast_reparsers_size = sizeof($fast_reparsers); + $fast_reparsers_size = count($fast_reparsers); $processed_records = 0; while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) { @@ -87,7 +102,6 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration if ($start === 1) { // Prevent CLI command from running these reparsers again - $reparser_manager = $this->container->get('text_reparser.manager'); $reparser_manager->update_resume_data($fast_reparsers[$resume_data['reparser']], 1, 0, $limit); $resume_data['reparser']++; -- cgit v1.2.1 From c1035c98e455548fe14fbf5443bb98137d4e3d5d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 31 Jan 2016 23:49:17 +0100 Subject: [ticket/14492] Rename files to help_phpbb and fix css tabbing PHPBB3-14492 --- .../db/migration/data/v320/add_help_phpbb.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php new file mode 100644 index 0000000000..4274f53520 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -0,0 +1,49 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class add_help_phpbb extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320a2', + ); + } + + public function effectively_installed() + { + return isset($this->config['help_send_statistics']); + } + + public function update_data() + { + return array( + array('config.add', array('help_send_statistics', true)), + array('module.remove', array( + 'acp', + false, + 'ACP_SEND_STATISTICS', + )), + array('module.add', array( + 'acp', + 'ACP_SERVER_CONFIGURATION', + array( + 'module_basename' => 'acp_help_phpbb', + 'modes' => array('help_phpbb'), + ), + )), + ); + } +} -- cgit v1.2.1 From 89fef2ce13a183c7b963032274f455a09a05f325 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 21 Feb 2016 22:14:58 +0100 Subject: [ticket/14492] Send statistics via ajax request Flooding ajax requests will try to be prevented and sending stats without JS will also properly work. PHPBB3-14492 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index 4274f53520..2634cee643 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -31,6 +31,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration { return array( array('config.add', array('help_send_statistics', true)), + array('config.add', array('help_send_statistics_time', 0)), array('module.remove', array( 'acp', false, -- cgit v1.2.1 From c54838b25f50dca71a2f516175621a7ccd39a071 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 9 Sep 2016 22:59:58 +0200 Subject: [ticket/14492] Update versions in files PHPBB3-14492 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index 2634cee643..afa67fbc58 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -18,7 +18,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v320a2', + '\phpbb\db\migration\data\v320\v320rc1', ); } -- cgit v1.2.1 From a35c8a924ee824a10468e75df375c870b550d550 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 6 Dec 2016 15:41:58 +0100 Subject: [prep-release-3.2.0-RC2] Add migration file for 3.2.0-RC2 --- phpBB/phpbb/db/migration/data/v320/v320rc2.php | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320rc2.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/v320rc2.php b/phpBB/phpbb/db/migration/data/v320/v320rc2.php new file mode 100644 index 0000000000..ec9bb62732 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320rc2.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320rc2 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-RC2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\remove_duplicate_migrations', + '\phpbb\db\migration\data\v31x\add_log_time_index', + '\phpbb\db\migration\data\v320\add_help_phpbb', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-RC2')), + ); + } +} -- cgit v1.2.1 From e0eeea800cb51217e4511c3bcfcba6406d89f314 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 6 Jan 2017 00:57:12 +0100 Subject: [ticket/14961] Add cookie notice as enablable feature Uses Insites cookieconsent v3.0.3: https://cookieconsent.insites.com PHPBB3-14961 --- .../phpbb/db/migration/data/v320/cookie_notice.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/cookie_notice.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/cookie_notice.php b/phpBB/phpbb/db/migration/data/v320/cookie_notice.php new file mode 100644 index 0000000000..75cb03b3ef --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/cookie_notice.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class cookie_notice extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320rc2', + ); + } + + public function update_data() + { + return array( + array('config.add', array('cookie_notice', false)), + ); + } +} -- cgit v1.2.1 From da8ec61ab2dba1c8bb770932a6983cddbbb1251c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 7 Jan 2017 11:48:15 +0100 Subject: [prep-release-3.2.0] Update version numbers and add 3.2.0 migration --- phpBB/phpbb/db/migration/data/v320/v320.php | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320.php (limited to 'phpBB/phpbb/db/migration/data/v320') diff --git a/phpBB/phpbb/db/migration/data/v320/v320.php b/phpBB/phpbb/db/migration/data/v320/v320.php new file mode 100644 index 0000000000..20e741cb8b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\increase_size_of_emotion', + '\phpbb\db\migration\data\v320\cookie_notice', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0')), + ); + } +} -- cgit v1.2.1