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/v310/notifications_board.php | 73 ---------------------- .../db/migration/data/v320/notifications_board.php | 73 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_board.php create mode 100644 phpBB/phpbb/db/migration/data/v320/notifications_board.php diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_board.php b/phpBB/phpbb/db/migration/data/v310/notifications_board.php deleted file mode 100644 index 525d94e984..0000000000 --- a/phpBB/phpbb/db/migration/data/v310/notifications_board.php +++ /dev/null @@ -1,73 +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 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); - } -} 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