From 29730e49ce81d6ecbe2922085ecaa714c1bfb178 Mon Sep 17 00:00:00 2001 From: battye Date: Fri, 28 Feb 2025 03:22:08 +0000 Subject: [PATCH] [ticket/17381] Add migration for topic_views to ULINT PHPBB-17381 --- .../data/v33x/topic_views_update.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v33x/topic_views_update.php diff --git a/phpBB/phpbb/db/migration/data/v33x/topic_views_update.php b/phpBB/phpbb/db/migration/data/v33x/topic_views_update.php new file mode 100644 index 0000000000..8402d548c4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v33x/topic_views_update.php @@ -0,0 +1,47 @@ + +* @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; + +class topic_views_update extends \phpbb\db\migration\migration +{ + public static function depends_on() + { + return [ + '\phpbb\db\migration\data\v33x\v3314', + ]; + } + + public function update_schema(): array + { + // This extends the topic view count field so we can support much larger values. + return [ + 'change_columns' => [ + $this->table_prefix . 'topics' => [ + 'topic_views' => ['ULINT', 0], + ], + ] + ]; + } + + public function revert_schema(): array + { + return [ + 'change_columns' => [ + $this->table_prefix . 'topics' => [ + 'topic_views' => ['UINT', 0], + ], + ] + ]; + } +}