From eb4b3ada4982c8a9b7a3029ba283cb7107eac5b1 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 9 Jan 2025 13:10:04 +0100 Subject: [PATCH] Adjust post_ip to support ipv6 --- common.php | 2 +- install/includes/schema.sql | 4 ++-- system/migrations/42.php | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 system/migrations/42.php diff --git a/common.php b/common.php index c63f4494..0969ac06 100644 --- a/common.php +++ b/common.php @@ -27,7 +27,7 @@ if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is const MYAAC = true; const MYAAC_VERSION = '1.0-RC.2'; -const DATABASE_VERSION = 41; +const DATABASE_VERSION = 42; const TABLE_PREFIX = 'myaac_'; define('START_TIME', microtime(true)); define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX')); diff --git a/install/includes/schema.sql b/install/includes/schema.sql index 1c8f4ccc..91853e07 100644 --- a/install/includes/schema.sql +++ b/install/includes/schema.sql @@ -1,4 +1,4 @@ -SET @myaac_database_version = 41; +SET @myaac_database_version = 42; CREATE TABLE `myaac_account_actions` ( @@ -91,7 +91,7 @@ CREATE TABLE `myaac_forum` `post_date` int(20) NOT NULL default '0', `last_edit_aid` int(20) NOT NULL default '0', `edit_date` int(20) NOT NULL default '0', - `post_ip` varchar(32) NOT NULL default '0.0.0.0', + `post_ip` varchar(45) NOT NULL default '0.0.0.0', `sticked` tinyint(1) NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), diff --git a/system/migrations/42.php b/system/migrations/42.php new file mode 100644 index 00000000..92408a59 --- /dev/null +++ b/system/migrations/42.php @@ -0,0 +1,15 @@ +modifyColumn(TABLE_PREFIX . 'forum', 'post_ip', "varchar(45) NOT NULL default '0.0.0.0'"); +}; + +$down = function () { + // there is no downgrade for this +}; +