From 3e92cb82e49cddf4b73db6de51bcf864902732f2 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Wed, 2 May 2007 08:56:17 +0000 Subject: [PATCH] support IPv6 lengths --- docs/NEWS | 3 +++ serendipity_config.inc.php | 2 +- sql/db.sql | 4 ++-- sql/db_update_1.2-alpha3_1.2_alpha4_mysql.sql | 2 ++ sql/db_update_1.2-alpha3_1.2_alpha4_postgres.sql | 13 +++++++++++++ sql/db_update_1.2-alpha3_1.2_alpha4_sqlite.sql | 0 6 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 sql/db_update_1.2-alpha3_1.2_alpha4_mysql.sql create mode 100644 sql/db_update_1.2-alpha3_1.2_alpha4_postgres.sql create mode 100644 sql/db_update_1.2-alpha3_1.2_alpha4_sqlite.sql diff --git a/docs/NEWS b/docs/NEWS index 9b6f7206..e90bfea0 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.2 () ------------------------------------------------------------------------ + * Change database types for IP addresses to varchar(64) to support + IPv6 (garvinhicking) + * Make statistics, karma and spamblock plugin only log 255 characters of HTTP User-Agent and Referrer strings to the database, as the fields are only varchar(255). Thanks to jemm4jemm! diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index cddb75da..18c9f2b3 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -42,7 +42,7 @@ if (defined('USE_MEMSNAP')) { } // The version string -$serendipity['version'] = '1.2-alpha3'; +$serendipity['version'] = '1.2-alpha4'; // Setting this to 'false' will enable debugging output. All alpa/beta/cvs snapshot versions will emit debug information by default. To increase the debug level (to enable Smarty debugging), set this flag to 'debug'. $serendipity['production'] = (preg_match('@\-(alpha|beta|cvs)@', $serendipity['version']) ? false : true); diff --git a/sql/db.sql b/sql/db.sql index 0c5bfd6d..b1cb4004 100644 --- a/sql/db.sql +++ b/sql/db.sql @@ -71,7 +71,7 @@ create table {PREFIX}comments ( author varchar(80) default null, email varchar(200) default null, url varchar(200) default null, - ip varchar(15) default null, + ip varchar(64) default null, body text, type varchar(100) default 'regular', subscribed {BOOLEAN}, @@ -184,7 +184,7 @@ create table {PREFIX}options ( CREATE INDEX options_idx ON {PREFIX}options (okey); CREATE TABLE {PREFIX}suppress ( - ip varchar(15) default NULL, + ip varchar(64) default NULL, scheme varchar(5), host varchar(128), port varchar(5), diff --git a/sql/db_update_1.2-alpha3_1.2_alpha4_mysql.sql b/sql/db_update_1.2-alpha3_1.2_alpha4_mysql.sql new file mode 100644 index 00000000..5b65f8a7 --- /dev/null +++ b/sql/db_update_1.2-alpha3_1.2_alpha4_mysql.sql @@ -0,0 +1,2 @@ +ALTER TABLE {PREFIX}comments CHANGE ip ip VARCHAR(64) NOT NULL; +ALTER TABLE {PREFIX}suppress CHANGE ip ip VARCHAR(65) NOT NULL; \ No newline at end of file diff --git a/sql/db_update_1.2-alpha3_1.2_alpha4_postgres.sql b/sql/db_update_1.2-alpha3_1.2_alpha4_postgres.sql new file mode 100644 index 00000000..4c5d885d --- /dev/null +++ b/sql/db_update_1.2-alpha3_1.2_alpha4_postgres.sql @@ -0,0 +1,13 @@ +ALTER TABLE {PREFIX}comments ADD COLUMN oldip varchar(64); +UPDATE {PREFIX}comments SET oldip = ip; +ALTER TABLE {PREFIX}comments DROP ip; +ALTER TABLE {PREFIX}comments ADD COLUMN ip varchar(64); +UPDATE {PREFIX}comments SET ip = oldip; +ALTER TABLE {PREFIX}comments DROP COLUMN oldip; + +ALTER TABLE {PREFIX}suppress ADD COLUMN oldip varchar(64); +UPDATE {PREFIX}suppress SET oldip = ip; +ALTER TABLE {PREFIX}suppress DROP ip; +ALTER TABLE {PREFIX}suppress ADD COLUMN ip varchar(64); +UPDATE {PREFIX}suppress SET ip = oldip; +ALTER TABLE {PREFIX}suppress DROP COLUMN oldip; diff --git a/sql/db_update_1.2-alpha3_1.2_alpha4_sqlite.sql b/sql/db_update_1.2-alpha3_1.2_alpha4_sqlite.sql new file mode 100644 index 00000000..e69de29b