Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…(PostgreSQL only)
  • Loading branch information...
commit 6ed5989c4afe8316d0b8a31e4c9395e48230b34d 1 parent 8d46327
gbateson authored
View
5 mod/hotpot/db/postgres7.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() {
View
2  mod/hotpot/db/postgres7.sql
@@ -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'
);
View
17 mod/hotpot/db/update_to_v2.php
@@ -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') {
Please sign in to comment.
Something went wrong with that request. Please try again.