Skip to content

Commit

Permalink
Adjust post_ip to support ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Jan 9, 2025
1 parent 68bdec7 commit eb4b3ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

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'));
Expand Down
4 changes: 2 additions & 2 deletions install/includes/schema.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SET @myaac_database_version = 41;
SET @myaac_database_version = 42;

CREATE TABLE `myaac_account_actions`
(
Expand Down Expand Up @@ -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`),
Expand Down
15 changes: 15 additions & 0 deletions system/migrations/42.php
Original file line number Diff line number Diff line change
@@ -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
};

0 comments on commit eb4b3ad

Please sign in to comment.