From a9a28859d4852be72ce782d079ee3183c4d54852 Mon Sep 17 00:00:00 2001 From: luzpaz Date: Tue, 15 Aug 2017 15:00:12 -0400 Subject: [ticket/15424] Multiple typo fixes in docs & comments Fixed typos in some docs, guidelines, some non-user-facing files. PHPBB3-15424 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php | 2 +- phpBB/phpbb/db/migration/data/v310/softdelete_p1.php | 2 +- phpBB/phpbb/db/migration/tool/module.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php index 10343438b3..247ccc7a76 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4_rc1.php @@ -117,7 +117,7 @@ class release_3_0_4_rc1 extends \phpbb\db\migration\migration } else { - // equivelant to "none", which is the "Display in user control panel" option + // equivalent to "none", which is the "Display in user control panel" option $sql_ary['field_show_profile'] = 1; } diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php index b1e7486e24..877cdc2fa3 100644 --- a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php @@ -132,7 +132,7 @@ class softdelete_p1 extends \phpbb\db\migration\migration /* * Using sql_case here to avoid "BIGINT UNSIGNED value is out of range" errors. * As we update all topics in 2 queries, one broken topic would stop the conversion - * for all topics and the surpressed error will cause the admin to not even notice it. + * for all topics and the suppressed error will cause the admin to not even notice it. */ $sql = 'UPDATE ' . $this->table_prefix . 'topics SET topic_posts_approved = topic_replies + 1, diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index e5133c8152..93c338437e 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -509,7 +509,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * Get parent module id * * @param string|int $parent_id The parent module_id|module_langname - * @param int|string|array $data The module_id, module_langname for existance checking or module data array for adding + * @param int|string|array $data The module_id, module_langname for existence checking or module data array for adding * @param bool $throw_exception The flag indicating if exception should be thrown on error * @return mixed The int parent module_id, an array of int parent module_id values or false * @throws \phpbb\db\migration\exception -- cgit v1.2.1 From 35fef8333ad1adf510ce7f414bdccc70849ae059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 7 Jun 2018 14:56:08 +0200 Subject: [ticket/15663] Add migration PHPBB3-15663 --- .../data/v330/remove_attachment_flash.php | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php new file mode 100644 index 0000000000..2150b5c1c9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.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\v330; + + +class remove_attachment_flash extends \phpbb\db\migration\migration +{ + // Following constants were deprecated in 3.3 + // and moved from constants.php to compatibility_globals.php, + // thus define them as class constants + const ATTACHMENT_CATEGORY_FLASH = 5; + + protected $cat_id = array( + self::ATTACHMENT_CATEGORY_FLASH, + ); + + public function update_data() + { + return array( + array('custom', array(array($this, 'remove_flash_group'))), + ); + } + + public function remove_flash_group() + { + // select group ids of outdated media + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('cat_id', $this->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 0fe4cbc17f9f544ea1d6b793819b243657b6bcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 7 Jun 2018 15:07:00 +0200 Subject: [ticket/15663] Remove empty line PHPBB3-15663 --- phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php | 1 - 1 file changed, 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php index 2150b5c1c9..90c2fe7400 100644 --- a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php +++ b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php @@ -13,7 +13,6 @@ namespace phpbb\db\migration\data\v330; - class remove_attachment_flash extends \phpbb\db\migration\migration { // Following constants were deprecated in 3.3 -- cgit v1.2.1 From 30303647f06300ea9bea31abf66bad651e92b722 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 6 Sep 2018 14:11:51 +0200 Subject: [ticket/15744] Remove useless sql_freeresults PHPBB3-15744 --- phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php index 90c2fe7400..11dc43483b 100644 --- a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php +++ b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php @@ -74,13 +74,11 @@ class remove_attachment_flash extends \phpbb\db\migration\migration WHERE ' . $this->db->sql_in_set('group_id', $group_ids); } - $result = $this->db->sql_query($sql); - $this->db->sql_freeresult($result); + $this->db->sql_query($sql); // 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); + $this->db->sql_query($sql); } } -- cgit v1.2.1 From b6cd02bacb08a77a1d9f82285ff1501d5c7e597c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 11 May 2019 23:22:27 +0200 Subject: [ticket/16052] Add 3.3.0-dev migration PHPBB3-16052 --- phpBB/phpbb/db/migration/data/v330/dev.php | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/dev.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/dev.php b/phpBB/phpbb/db/migration/data/v330/dev.php new file mode 100644 index 0000000000..209f9fc7ec --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/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\v330; + +class dev extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.0-dev', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v327', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.3.0-dev')), + ); + } +} -- cgit v1.2.1 From f41c51d1ecc36bc6e5dffc70ad7a5ed50d4ec7ea Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 9 Aug 2019 22:43:04 +0200 Subject: [ticket/11327] Add reset token columns & config setting PHPBB3-11327 --- .../db/migration/data/v330/reset_password.php | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/reset_password.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/reset_password.php b/phpBB/phpbb/db/migration/data/v330/reset_password.php new file mode 100644 index 0000000000..87131c6e93 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/reset_password.php @@ -0,0 +1,48 @@ + + * @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\v330; + +class reset_password extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v330\dev', + ); + } + + public function update_schema() + { + return [ + 'add_columns' => [ + $this->table_prefix . 'users' => [ + 'reset_token' => ['VCHAR:64', '', 'after' => 'user_actkey'], + 'reset_token_expiration' => ['TIMESTAMP', 0, 'after' => 'reset_token'], + ], + ], + ]; + } + + public function revert_schema() + { + return [ + 'drop_columns' => [ + $this->table_prefix . 'users' => [ + 'reset_token', + 'reset_token_expiration', + ], + ], + ]; + } +} -- cgit v1.2.1 From 7a3e351178fde9d8b785867868fb40cbae4c8ab2 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 22 Aug 2019 14:05:58 +0200 Subject: [ticket/11327] Clean up code style a bit PHPBB3-11327 --- phpBB/phpbb/db/migration/data/v330/reset_password.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/reset_password.php b/phpBB/phpbb/db/migration/data/v330/reset_password.php index 87131c6e93..953d478ccc 100644 --- a/phpBB/phpbb/db/migration/data/v330/reset_password.php +++ b/phpBB/phpbb/db/migration/data/v330/reset_password.php @@ -17,9 +17,9 @@ class reset_password extends \phpbb\db\migration\migration { static public function depends_on() { - return array( + return [ '\phpbb\db\migration\data\v330\dev', - ); + ]; } public function update_schema() -- cgit v1.2.1 From 60bc949ba1d5a6851e525868f69e997d4c8a2075 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 3 Oct 2019 23:05:02 +0200 Subject: [ticket/14465] Remove setting for maximum password length PHPBB3-14465 --- .../migration/data/v330/remove_max_pass_chars.php | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/remove_max_pass_chars.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/remove_max_pass_chars.php b/phpBB/phpbb/db/migration/data/v330/remove_max_pass_chars.php new file mode 100644 index 0000000000..10e5ee385d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/remove_max_pass_chars.php @@ -0,0 +1,43 @@ + + * @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\v330; + +class remove_max_pass_chars extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return !$this->config->offsetExists('max_pass_chars'); + } + + public static function depends_on() + { + return [ + '\phpbb\db\migration\data\v330\dev', + ]; + } + + public function update_data() + { + return [ + ['config.remove', ['max_pass_chars']], + ]; + } + + public function revert_data() + { + return [ + ['config.add', ['max_pass_chars', 100]], + ]; + } +} -- cgit v1.2.1 From 2f220a07d15f56fa340ab95221d4c45f7f4e2c11 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 19 Oct 2019 15:19:42 +0200 Subject: [prep-release-3.3.0-b1] Add migration for 3.3.0-b1 --- phpBB/phpbb/db/migration/data/v330/v330b1.php | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/v330b1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/v330b1.php b/phpBB/phpbb/db/migration/data/v330/v330b1.php new file mode 100644 index 0000000000..ac4fec3d6e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/v330b1.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\v330; + +class v330b1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.0-b1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v330\reset_password', + '\phpbb\db\migration\data\v330\remove_attachment_flash', + '\phpbb\db\migration\data\v330\remove_max_pass_chars', + '\phpbb\db\migration\data\v32x\v328', + '\phpbb\db\migration\data\v330\dev', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.3.0-b1')), + ); + } +} -- cgit v1.2.1 From cf7c3dcab5f9d6d38894c97cabf93db72e04d04d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 20 Oct 2019 21:33:05 +0200 Subject: [ticket/15437] Add migration for updating jQuery to 3.4.1 PHPBB3-15437 --- .../phpbb/db/migration/data/v330/jquery_update.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/jquery_update.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/jquery_update.php b/phpBB/phpbb/db/migration/data/v330/jquery_update.php new file mode 100644 index 0000000000..f1ac6cdd41 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/jquery_update.php @@ -0,0 +1,37 @@ + + * @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\v330; + +class jquery_update extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->config['load_jquery_url'] === '//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js'; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v330\dev', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js')), + ); + } + +} -- cgit v1.2.1 From 396a8214db6654947f0cceeca85f60c1edae6ffe Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 21 Oct 2019 20:05:12 +0200 Subject: [prep-release-3.3.0-b1] Add jquery update migration to 330b1 dependencies --- phpBB/phpbb/db/migration/data/v330/v330b1.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/v330b1.php b/phpBB/phpbb/db/migration/data/v330/v330b1.php index ac4fec3d6e..3df44504fc 100644 --- a/phpBB/phpbb/db/migration/data/v330/v330b1.php +++ b/phpBB/phpbb/db/migration/data/v330/v330b1.php @@ -23,6 +23,7 @@ class v330b1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v330\jquery_update', '\phpbb\db\migration\data\v330\reset_password', '\phpbb\db\migration\data\v330\remove_attachment_flash', '\phpbb\db\migration\data\v330\remove_max_pass_chars', -- cgit v1.2.1 From 6ccffec90695becd92d1144f6cbd9ef72f0d9b51 Mon Sep 17 00:00:00 2001 From: PayBas Date: Sat, 17 May 2014 11:20:37 +0200 Subject: [ticket/12559] Add forum setting to limit subforum legend Squashed all commits, they were basically just typos and errors PHPBB3-12559 --- .../db/migration/data/v310/forums_legend_limit.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php new file mode 100644 index 0000000000..9bc8ad9044 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php @@ -0,0 +1,45 @@ +db_tools->sql_column_exists($this->table_prefix . 'forums', 'display_subforum_limit'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\beta3'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_limit', + ), + ), + ); + } +} -- cgit v1.2.1 From b14c7c351104634990c80e64f58e3e28ea5826e0 Mon Sep 17 00:00:00 2001 From: PayBas Date: Fri, 30 May 2014 16:51:16 +0200 Subject: [ticket/12559] Updated copyright information PHPBB3-12559 --- phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php index 9bc8ad9044..c37fc7d3df 100644 --- a/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php +++ b/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php @@ -1,9 +1,13 @@ +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. * */ -- cgit v1.2.1 From e2de342d3ac53909a5c78f08100152d03a58f3bf Mon Sep 17 00:00:00 2001 From: PayBas Date: Tue, 10 Feb 2015 15:02:36 +0100 Subject: [ticket/12559] Update migration dependencies PHPBB3-12559 --- .../db/migration/data/v310/forums_legend_limit.php | 49 ---------------------- .../db/migration/data/v31x/forums_legend_limit.php | 49 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php create mode 100644 phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php deleted file mode 100644 index c37fc7d3df..0000000000 --- a/phpBB/phpbb/db/migration/data/v310/forums_legend_limit.php +++ /dev/null @@ -1,49 +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\v310; - -class forums_legend_limit extends \phpbb\db\migration\migration -{ - public function effectively_installed() - { - return $this->db_tools->sql_column_exists($this->table_prefix . 'forums', 'display_subforum_limit'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data\v310\beta3'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_limit', - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php new file mode 100644 index 0000000000..f2024bdaf9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.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\v31x; + +class forums_legend_limit extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'forums', 'display_subforum_limit'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v31x\v313'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_limit', + ), + ), + ); + } +} -- cgit v1.2.1 From 729e2f5d0865d843e804d1a97205df1e5f273bbd Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 1 Nov 2019 16:52:02 +0100 Subject: [ticket/12559] Move migration to v330 folder PHPBB3-12559 --- .../db/migration/data/v31x/forums_legend_limit.php | 49 ---------------------- .../db/migration/data/v330/forums_legend_limit.php | 49 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php create mode 100644 phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php deleted file mode 100644 index f2024bdaf9..0000000000 --- a/phpBB/phpbb/db/migration/data/v31x/forums_legend_limit.php +++ /dev/null @@ -1,49 +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\v31x; - -class forums_legend_limit extends \phpbb\db\migration\migration -{ - public function effectively_installed() - { - return $this->db_tools->sql_column_exists($this->table_prefix . 'forums', 'display_subforum_limit'); - } - - static public function depends_on() - { - return array('\phpbb\db\migration\data\v31x\v313'); - } - - public function update_schema() - { - return array( - 'add_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_limit', - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php new file mode 100644 index 0000000000..45b6547ede --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.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\v330; + +class forums_legend_limit extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'forums', 'display_subforum_limit'); + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v330\v330b1'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'forums' => array( + 'display_subforum_limit', + ), + ), + ); + } +} -- cgit v1.2.1 From 85837d48b20c63f86050d0125942b25928deb1a5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 4 Nov 2019 17:31:18 +0100 Subject: [ticket/12559] Use short array syntax PHPBB3-12559 --- .../db/migration/data/v330/forums_legend_limit.php | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php b/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php index 45b6547ede..c5a4beef38 100644 --- a/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php +++ b/phpBB/phpbb/db/migration/data/v330/forums_legend_limit.php @@ -22,28 +22,28 @@ class forums_legend_limit extends \phpbb\db\migration\migration static public function depends_on() { - return array('\phpbb\db\migration\data\v330\v330b1'); + return ['\phpbb\db\migration\data\v330\v330b1']; } public function update_schema() { - return array( - 'add_columns' => array( - $this->table_prefix . 'forums' => array( - 'display_subforum_limit' => array('BOOL', 0, 'after' => 'display_subforum_list'), - ), - ), - ); + return [ + 'add_columns' => [ + $this->table_prefix . 'forums' => [ + 'display_subforum_limit' => ['BOOL', 0, 'after' => 'display_subforum_list'], + ], + ], + ]; } public function revert_schema() { - return array( - 'drop_columns' => array( - $this->table_prefix . 'forums' => array( + return [ + 'drop_columns' => [ + $this->table_prefix . 'forums' => [ 'display_subforum_limit', - ), - ), - ); + ], + ], + ]; } } -- cgit v1.2.1 From aed7e369c30bb724a1496fbda34707280a56ea22 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 18 Nov 2019 20:56:05 +0100 Subject: [ticket/16167] Add migration for removing user_email_hash PHPBB3-16167 --- .../db/migration/data/v330/remove_email_hash.php | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/remove_email_hash.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php b/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php new file mode 100644 index 0000000000..dc43678625 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php @@ -0,0 +1,57 @@ + + * @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\v330; + +class remove_email_hash extends \phpbb\db\migration\migration +{ + public function update_schema() + { + return [ + 'add_index' => [ + $this->table_prefix . 'users' => [ + 'user_email' => ['user_email'], + ], + ], + 'drop_keys' => [ + $this->table_prefix . 'users' => [ + 'user_email_hash', + ], + ], + 'drop_columns' => [ + $this->table_prefix . 'users' => ['user_email_hash'], + ], + ]; + } + + public function revert_schema() + { + return [ + 'add_columns' => [ + $this->table_prefix . 'users' => [ + 'user_email_hash' => ['BINT', 0], + ], + ], + 'add_index' => [ + $this->table_prefix . 'users' => [ + 'user_email_hash', + ], + ], + 'drop_keys' => [ + $this->table_prefix . 'users' => [ + 'user_email' => ['user_email'], + ], + ], + ]; + } +} -- cgit v1.2.1 From 63b7518a0f8b09d23a0d45c50d98aa3ff607f613 Mon Sep 17 00:00:00 2001 From: v12mike Date: Tue, 10 Sep 2019 08:33:01 -0400 Subject: [ticket/9837] Make unapproved posts visible to posters Improvements for feature following review PHPBB3-9837 --- .../v330/add_display_unapproved_posts_config.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php new file mode 100644 index 0000000000..e3d2bddb0b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.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\v330; + +class add_display_unapproved_posts_config extends \phpbb\db\migration\migration +{ + public function update_data() + { + return array( + array('config.add', array('display_unapproved_posts', 1)), + ); + } +} -- cgit v1.2.1 From 0f57f3d90d1983c49bde1d56b6018a761f92264b Mon Sep 17 00:00:00 2001 From: v12mike Date: Mon, 4 Nov 2019 09:21:27 -0500 Subject: [ticket/9837] Display unapproved posts to their authors Coding guidelines fixes PHPBB3-9837 --- .../db/migration/data/v330/add_display_unapproved_posts_config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php index e3d2bddb0b..d45f557a8b 100644 --- a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php +++ b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php @@ -17,8 +17,8 @@ class add_display_unapproved_posts_config extends \phpbb\db\migration\migration { public function update_data() { - return array( - array('config.add', array('display_unapproved_posts', 1)), - ); + return [ + ['config.add', ['display_unapproved_posts', 1]], + ]; } } -- cgit v1.2.1 From 29be971fad6ba90c147d0fd8b2d07d69e5efddec Mon Sep 17 00:00:00 2001 From: v12mike Date: Tue, 19 Nov 2019 07:20:44 -0500 Subject: [ticket/9837] Make unapproved posts visible to author review comments PHPBB3-9837 --- .../db/migration/data/v330/add_display_unapproved_posts_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php index d45f557a8b..b429270827 100644 --- a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php +++ b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php @@ -19,6 +19,6 @@ class add_display_unapproved_posts_config extends \phpbb\db\migration\migration { return [ ['config.add', ['display_unapproved_posts', 1]], - ]; + ]; } } -- cgit v1.2.1 From d55e421c0fa4efc76e3513eee7da31e05675a6b9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 22 Nov 2019 11:06:15 +0100 Subject: [prep-release-3.3.0-b2] Add migration for 3.3.0-b2 --- phpBB/phpbb/db/migration/data/v330/v330b2.php | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/v330b2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/v330b2.php b/phpBB/phpbb/db/migration/data/v330/v330b2.php new file mode 100644 index 0000000000..1badc1387a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/v330b2.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\v330; + +class v330b2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.0-b2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v330\add_display_unapproved_posts_config', + '\phpbb\db\migration\data\v330\forums_legend_limit', + '\phpbb\db\migration\data\v330\remove_email_hash', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.3.0-b2')), + ); + } +} -- cgit v1.2.1 From a0251ec1d97787f750917029e042e04f97863bc1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 21 Dec 2019 10:48:37 +0100 Subject: [prep-release-3.3.0-RC1] Add migration for 3.3.0-RC1 --- phpBB/phpbb/db/migration/data/v330/v330rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/v330rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/v330rc1.php b/phpBB/phpbb/db/migration/data/v330/v330rc1.php new file mode 100644 index 0000000000..52193750cc --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/v330rc1.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\v330; + +class v330rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.0-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v330\v330b2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.3.0-RC1')), + ); + } +} -- cgit v1.2.1 From e6a84dcb605b9101dc923963d6f2ed5766410726 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 23 Dec 2019 15:18:40 +0100 Subject: [ticket/16263] Ensure that remove_email_hash depends on migration adding hash PHPBB3-16263 --- phpBB/phpbb/db/migration/data/v330/remove_email_hash.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php b/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php index dc43678625..8ac8f4ed72 100644 --- a/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php +++ b/phpBB/phpbb/db/migration/data/v330/remove_email_hash.php @@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v330; class remove_email_hash extends \phpbb\db\migration\migration { + static public function depends_on() + { + return ['\phpbb\db\migration\data\v30x\release_3_0_0']; + } + public function update_schema() { return [ -- cgit v1.2.1 From 364461b58fd40af8fe8c7513fe9424de483055b9 Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Mon, 30 Dec 2019 02:25:26 +0100 Subject: [ticket/16279] Add permission for Emoji in topic title PHPBB3-16279 --- .../migration/data/v32x/user_emoji_permission.php | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php new file mode 100644 index 0000000000..a915f1e140 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php @@ -0,0 +1,43 @@ + +* @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\v32x; + +class user_emoji_permission extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = 'u_emoji'"; + $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 [ + '\phpbb\db\migration\data\v32x\v329rc1', + ]; + } + + public function update_data() + { + return [ + ['permission.add', ['u_emoji']], + ]; + } +} -- cgit v1.2.1 From 79287abd7b3b6e837774bda6971061c923050d45 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 1 Jan 2020 16:23:23 +0100 Subject: [ticket/16285] Add sanity checks to migrations for 3.3 PHPBB3-16285 --- .../data/v330/add_display_unapproved_posts_config.php | 10 ++++++++++ phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php | 9 +++++++-- phpBB/phpbb/db/migration/data/v330/v330b2.php | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php index b429270827..209aba3646 100644 --- a/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php +++ b/phpBB/phpbb/db/migration/data/v330/add_display_unapproved_posts_config.php @@ -15,6 +15,16 @@ namespace phpbb\db\migration\data\v330; class add_display_unapproved_posts_config extends \phpbb\db\migration\migration { + public function effectively_installed() + { + return $this->config->offsetExists('display_unapproved_posts'); + } + + public static function depends_on() + { + return ['\phpbb\db\migration\data\v330\dev',]; + } + public function update_data() { return [ diff --git a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php index 11dc43483b..c136960905 100644 --- a/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php +++ b/phpBB/phpbb/db/migration/data/v330/remove_attachment_flash.php @@ -21,8 +21,13 @@ class remove_attachment_flash extends \phpbb\db\migration\migration const ATTACHMENT_CATEGORY_FLASH = 5; protected $cat_id = array( - self::ATTACHMENT_CATEGORY_FLASH, - ); + self::ATTACHMENT_CATEGORY_FLASH, + ); + + public static function depends_on() + { + return ['\phpbb\db\migration\data\v330\dev',]; + } public function update_data() { diff --git a/phpBB/phpbb/db/migration/data/v330/v330b2.php b/phpBB/phpbb/db/migration/data/v330/v330b2.php index 1badc1387a..cb2198aad7 100644 --- a/phpBB/phpbb/db/migration/data/v330/v330b2.php +++ b/phpBB/phpbb/db/migration/data/v330/v330b2.php @@ -26,6 +26,7 @@ class v330b2 extends \phpbb\db\migration\migration '\phpbb\db\migration\data\v330\add_display_unapproved_posts_config', '\phpbb\db\migration\data\v330\forums_legend_limit', '\phpbb\db\migration\data\v330\remove_email_hash', + '\phpbb\db\migration\data\v330\v330b1', ); } -- cgit v1.2.1 From 0806d34eee9a302bb8a699ee49f04b0592aa06c6 Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Wed, 1 Jan 2020 19:11:06 +0100 Subject: [ticket/16279] Add permission for Emoji in topic title PHPBB3-16279 --- phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php index a915f1e140..98759c78ee 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php @@ -38,6 +38,7 @@ class user_emoji_permission extends \phpbb\db\migration\migration { return [ ['permission.add', ['u_emoji']], + ['permission.permission_set', ['REGISTERED', 'u_emoji', 'group']], ]; } } -- cgit v1.2.1 From 944a748cb6d235c58e52c22254f466e941f3d449 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 4 Jan 2020 14:35:26 +0100 Subject: [prep-release-3.3.0] Add migration for 3.3.0 --- phpBB/phpbb/db/migration/data/v330/v330.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/v330.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v330/v330.php b/phpBB/phpbb/db/migration/data/v330/v330.php new file mode 100644 index 0000000000..05baffbdbd --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/v330.php @@ -0,0 +1,37 @@ + +* @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\v330; + +class v330 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.3.0', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v329', + '\phpbb\db\migration\data\v330\v330rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.3.0')), + ); + } +} -- cgit v1.2.1