aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-05-12 08:56:05 +0000
committerMario <mario@mariovavti.com>2020-05-12 08:56:05 +0000
commit326644104c169ddcc5188af994e1a0fa932ad99f (patch)
tree2c740132b0d07c73da9b0e208ee1253ef90dbdb2
parent1520a26e0f4356bef13f5988cc5b5db352e2e14a (diff)
downloadvolse-hubzilla-326644104c169ddcc5188af994e1a0fa932ad99f.tar.gz
volse-hubzilla-326644104c169ddcc5188af994e1a0fa932ad99f.tar.bz2
volse-hubzilla-326644104c169ddcc5188af994e1a0fa932ad99f.zip
really fix update for postgres
-rw-r--r--Zotlabs/Update/_1238.php26
1 files changed, 19 insertions, 7 deletions
diff --git a/Zotlabs/Update/_1238.php b/Zotlabs/Update/_1238.php
index e08cd334f..92dfeef38 100644
--- a/Zotlabs/Update/_1238.php
+++ b/Zotlabs/Update/_1238.php
@@ -20,13 +20,25 @@ class _1238 {
);
// fix singleton networks hubloc_id_url
- $r2 = q("UPDATE hubloc
- LEFT JOIN xchan ON hubloc.hubloc_hash = xchan.xchan_hash
- SET hubloc.hubloc_id_url = xchan.xchan_url
- WHERE hubloc.hubloc_network IN ('activitypub', 'diaspora', 'friendica-over-diaspora', 'gnusoc')
- AND hubloc.hubloc_id_url = ''
- AND xchan.xchan_url != ''"
- );
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r2 = q("UPDATE hubloc
+ LEFT JOIN xchan ON hubloc_hash = xchan_hash
+ SET hubloc_id_url = xchan_url
+ WHERE hubloc_network IN ('activitypub', 'diaspora', 'friendica-over-diaspora', 'gnusoc')
+ AND hubloc_id_url = ''
+ AND xchan_url != ''"
+ );
+ }
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r2 = q("UPDATE hubloc
+ SET hubloc_id_url = xchan_url
+ FROM xchan
+ WHERE hubloc_hash = xchan_hash
+ AND hubloc_network IN ('activitypub', 'diaspora', 'friendica-over-diaspora', 'gnusoc')
+ AND hubloc_id_url = ''
+ AND xchan_url != ''"
+ );
+ }
if($r1 && $r2) {
q("COMMIT");