From a7a53de34d6372ccec79d3944741821b8592911e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 14 May 2024 21:42:02 +0200 Subject: [PATCH] [ticket/17312] Add migration for user_last_active column PHPBB3-17312 --- .../data/v33x/add_user_last_active.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v33x/add_user_last_active.php diff --git a/phpBB/phpbb/db/migration/data/v33x/add_user_last_active.php b/phpBB/phpbb/db/migration/data/v33x/add_user_last_active.php new file mode 100644 index 0000000000..58cc4f0240 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v33x/add_user_last_active.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\v33x; + +use phpbb\db\migration\migration; + +class add_user_last_active extends migration +{ + public static function depends_on() + { + return [ + '\phpbb\db\migration\data\v33x\v3311', + ]; + } + + public function update_schema() + { + return [ + 'add_columns' => [ + $this->table_prefix . 'users' => [ + 'user_last_active' => ['TIMESTAMP', 0], + ], + ], + ]; + } + + public function revert_schema() + { + return [ + 'drop_columns' => [ + $this->table_prefix . 'users' => [ + 'user_last_active' => ['TIMESTAMP', 0], + ], + ], + ]; + } +}