aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2015-01-18 18:33:32 -0800
committerHabeas Codice <habeascodice@federated.social>2015-01-18 18:33:32 -0800
commit547d852ef7bb22e84ed4cf239912935150b2f784 (patch)
treef7f29594aa736811dae14ce4bbe2a885d5808ed2
parent89a2012f7f109a775199570853cf0eea1b8aaf35 (diff)
downloadvolse-hubzilla-547d852ef7bb22e84ed4cf239912935150b2f784.tar.gz
volse-hubzilla-547d852ef7bb22e84ed4cf239912935150b2f784.tar.bz2
volse-hubzilla-547d852ef7bb22e84ed4cf239912935150b2f784.zip
fix update 1131 for postgres databases
-rwxr-xr-xboot.php2
-rw-r--r--install/update.php15
2 files changed, 15 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 7d051e5f2..2022ab2c1 100755
--- a/boot.php
+++ b/boot.php
@@ -49,7 +49,7 @@ define ( 'RED_PLATFORM', 'redmatrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1132 );
+define ( 'DB_UPDATE_VERSION', 1133 );
/**
* Constant with a HTML line break.
diff --git a/install/update.php b/install/update.php
index f7ccb8210..381ea0828 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1132 );
+define( 'UPDATE_VERSION' , 1133 );
/**
*
@@ -1486,6 +1486,9 @@ function update_r1130() {
}
function update_r1131() {
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) // make sure this gets skipped for anyone who hasn't run it yet, it will fail on pg
+ return UPDATE_SUCCESS;
+
$r1 = q("ALTER TABLE `abook` ADD `abook_rating_text` TEXT NOT NULL DEFAULT '' AFTER `abook_rating` ");
$r2 = q("ALTER TABLE `xlink` ADD `xlink_rating_text` TEXT NOT NULL DEFAULT '' AFTER `xlink_rating` ");
@@ -1493,4 +1496,14 @@ function update_r1131() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
+}
+
+function update_r1132() {
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { // correct previous failed update
+ $r1 = q("ALTER TABLE abook ADD abook_rating_text TEXT NOT NULL DEFAULT '' ");
+ $r2 = q("ALTER TABLE xlink ADD xlink_rating_text TEXT NOT NULL DEFAULT '' ");
+ if(!$r1 || !$r2)
+ return UPDATE_FAILED;
+ }
+ return UPDATE_SUCCESS;
} \ No newline at end of file