[geeklog-cvs] geeklog: Fixed broken poll upgrade procedure for 2.1.0
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Sep 19 10:20:23 EDT 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/39be7f133232
changeset: 7326:39be7f133232
user: Tom <websitemaster at cogeco.net>
date: Mon Sep 14 20:40:59 2009 -0400
description:
Fixed broken poll upgrade procedure for 2.1.0
diffstat:
plugins/polls/functions.inc | 14 +++++++++++++-
plugins/polls/sql/mssql_updates.php | 20 ++++++++++++++++++--
plugins/polls/sql/mysql_updates.php | 19 ++++++++++++++++++-
3 files changed, 49 insertions(+), 4 deletions(-)
diffs (90 lines):
diff -r 27d076900eaf -r 39be7f133232 plugins/polls/functions.inc
--- a/plugins/polls/functions.inc Mon Sep 14 09:33:05 2009 -0400
+++ b/plugins/polls/functions.inc Mon Sep 14 20:40:59 2009 -0400
@@ -1158,9 +1158,21 @@
}
}
+ $current_version = '2.1.0';
+ break;
+ case '2.1.0':
+ if (isset($_UPDATES[$current_version])) {
+ $_SQL = $_UPDATES[$current_version];
+ foreach ($_SQL as $sql) {
+ DB_query($sql);
+ }
+ }
+
+ update_ConfValues_2_1_0();
+
$current_version = '2.1.1';
break;
-
+
default:
$done = true;
}
diff -r 27d076900eaf -r 39be7f133232 plugins/polls/sql/mssql_updates.php
--- a/plugins/polls/sql/mssql_updates.php Mon Sep 14 09:33:05 2009 -0400
+++ b/plugins/polls/sql/mssql_updates.php Mon Sep 14 20:40:59 2009 -0400
@@ -38,10 +38,26 @@
"ALTER TABLE {$_TABLES['pollanswers']} ALTER COLUMN [pid] VARCHARS(40)",
"ALTER TABLE {$_TABLES['pollquestions']} ALTER COLUMN [pid] VARCHARS(40)",
"ALTER TABLE {$_TABLES['polltopics']} ALTER COLUMN [pid] VARCHARS(40)",
- "ALTER TABLE {$_TABLES['pollvoters']} ALTER COLUMN [pid] VARCHARS(40)",
+ "ALTER TABLE {$_TABLES['pollvoters']} ALTER COLUMN [pid] VARCHARS(40)"
+ ),
+
+ '2.1.0' => array(
"ALTER TABLE {$_TABLES['polltopics']} ADD meta_description [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL AFTER topic, ADD meta_keywords [meta_keywords] [varchar] (5000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL AFTER meta_description"
)
-
);
+function update_ConfValues_2_1_0()
+{
+ global $_CONF, $_PO_DEFAULT;
+
+ require_once $_CONF['path_system'] . 'classes/config.class.php';
+
+ $c = config::get_instance();
+
+ // meta tag config options.
+ $c->add('meta_tags', $_PO_DEFAULT['meta_tags'], 'select', 0, 0, 0, 100, true, 'polls');
+
+ return true;
+}
+
?>
diff -r 27d076900eaf -r 39be7f133232 plugins/polls/sql/mysql_updates.php
--- a/plugins/polls/sql/mysql_updates.php Mon Sep 14 09:33:05 2009 -0400
+++ b/plugins/polls/sql/mysql_updates.php Mon Sep 14 20:40:59 2009 -0400
@@ -38,10 +38,27 @@
"ALTER TABLE {$_TABLES['pollanswers']} CHANGE pid pid varchar(40) NOT NULL default ''",
"ALTER TABLE {$_TABLES['pollquestions']} CHANGE pid pid varchar(40) NOT NULL default ''",
"ALTER TABLE {$_TABLES['polltopics']} CHANGE pid pid varchar(40) NOT NULL default ''",
- "ALTER TABLE {$_TABLES['pollvoters']} CHANGE pid pid varchar(40) NOT NULL default ''",
+ "ALTER TABLE {$_TABLES['pollvoters']} CHANGE pid pid varchar(40) NOT NULL default ''"
+ ),
+
+ '2.1.0' => array(
"ALTER TABLE {$_TABLES['polltopics']} ADD meta_description TEXT NULL AFTER topic, ADD meta_keywords TEXT NULL AFTER meta_description"
)
);
+function update_ConfValues_2_1_0()
+{
+ global $_CONF, $_PO_DEFAULT;
+
+ require_once $_CONF['path_system'] . 'classes/config.class.php';
+
+ $c = config::get_instance();
+
+ // meta tag config options.
+ $c->add('meta_tags', $_PO_DEFAULT['meta_tags'], 'select', 0, 0, 0, 100, true, 'polls');
+
+ return true;
+}
+
?>
More information about the geeklog-cvs
mailing list