Adjust post_ip to support ipv6

This commit is contained in:
slawkens 2025-01-09 13:10:04 +01:00
parent 68bdec7c18
commit eb4b3ada49
3 changed files with 18 additions and 3 deletions

View File

@ -27,7 +27,7 @@ if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is
const MYAAC = true; const MYAAC = true;
const MYAAC_VERSION = '1.0-RC.2'; const MYAAC_VERSION = '1.0-RC.2';
const DATABASE_VERSION = 41; const DATABASE_VERSION = 42;
const TABLE_PREFIX = 'myaac_'; const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true)); define('START_TIME', microtime(true));
define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX')); define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX'));

View File

@ -1,4 +1,4 @@
SET @myaac_database_version = 41; SET @myaac_database_version = 42;
CREATE TABLE `myaac_account_actions` CREATE TABLE `myaac_account_actions`
( (
@ -91,7 +91,7 @@ CREATE TABLE `myaac_forum`
`post_date` int(20) NOT NULL default '0', `post_date` int(20) NOT NULL default '0',
`last_edit_aid` int(20) NOT NULL default '0', `last_edit_aid` int(20) NOT NULL default '0',
`edit_date` 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', `sticked` tinyint(1) NOT NULL DEFAULT '0',
`closed` tinyint(1) NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),

15
system/migrations/42.php Normal file
View File

@ -0,0 +1,15 @@
<?php
/**
* @var OTS_DB_MySQL $db
*/
// 2025-09-01
// resize forum.post_ip to support ipv6
$up = function () use ($db) {
$db->modifyColumn(TABLE_PREFIX . 'forum', 'post_ip', "varchar(45) NOT NULL default '0.0.0.0'");
};
$down = function () {
// there is no downgrade for this
};