Permalink
Browse files

in "hotpot" table, rename "microreporting" field to "clickreporting" …

…(PostgreSQL only)
  • Loading branch information...
1 parent 8d46327 commit 6ed5989c4afe8316d0b8a31e4c9395e48230b34d gbateson committed Jan 17, 2006
Showing with 22 additions and 2 deletions.
  1. +5 −0 mod/hotpot/db/postgres7.php
  2. +1 −1 mod/hotpot/db/postgres7.sql
  3. +16 −1 mod/hotpot/db/update_to_v2.php
@@ -22,6 +22,11 @@ function hotpot_upgrade($oldversion) {
$ok = $ok && hotpot_get_update_to_v2();
$ok = $ok && hotpot_update_to_v2_1_6();
}
+ // update to HotPot v2.1.8
+ if ($oldversion < 2005090708) {
+ $ok = $ok && hotpot_get_update_to_v2();
+ $ok = $ok && hotpot_update_to_v2_1_8();
+ }
return $ok;
}
function hotpot_get_update_to_v2() {
@@ -23,7 +23,7 @@ CREATE TABLE prefix_hotpot (
attempts INT2 NOT NULL default '0',
password VARCHAR(255) NOT NULL default '',
subnet VARCHAR(255) NOT NULL default '',
- microreporting INT2 NOT NULL default '0',
+ clickreporting INT2 NOT NULL default '0',
timecreated INT4 NOT NULL default '0',
timemodified INT4 NOT NULL default '0'
);
@@ -1,6 +1,21 @@
<?PHP
+function hotpot_update_to_v2_1_8() {
+ global $CFG;
+ $ok = true;
+ if (strtolower($CFG->dbtype)=='postgres7') {
+ // add, delete and rename certain fields and indexes
+ // that were not correctly setup by postgres7.sql
+
+ // hotpot
+ $table = 'hotpot';
+ if (hotpot_db_field_exists($table, 'microreporting')) {
+ $ok = $ok && hotpot_db_update_field_type($table, 'microreporting', 'clickreporting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', '0');
+ }
+ }
+ return $ok;
+}
function hotpot_update_to_v2_1_6() {
- global $CFG, $db;
+ global $CFG;
$ok = true;
if (strtolower($CFG->dbtype)=='postgres7') {

0 comments on commit 6ed5989

Please sign in to comment.