aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-01-07 20:34:47 +0000
committerMario <mario@mariovavti.com>2024-01-07 20:34:47 +0000
commitca216ae819646191f13053b4211dd7c52a25e676 (patch)
treee9dd50b28e76eba37d8ebf8dd3e16887ff91cf21
parent4713241444ca045c38c4d855a7e597be58c043df (diff)
downloadvolse-hubzilla-ca216ae819646191f13053b4211dd7c52a25e676.tar.gz
volse-hubzilla-ca216ae819646191f13053b4211dd7c52a25e676.tar.bz2
volse-hubzilla-ca216ae819646191f13053b4211dd7c52a25e676.zip
set default value for postgres only
-rw-r--r--Zotlabs/Update/_1260.php10
-rw-r--r--Zotlabs/Update/_1261.php4
-rw-r--r--install/schema_postgres.sql16
3 files changed, 18 insertions, 12 deletions
diff --git a/Zotlabs/Update/_1260.php b/Zotlabs/Update/_1260.php
index eac2bae8b..7f91418f6 100644
--- a/Zotlabs/Update/_1260.php
+++ b/Zotlabs/Update/_1260.php
@@ -18,8 +18,14 @@ class _1260 {
dbq("START TRANSACTION");
- $r1 = dbq("ALTER TABLE channel ADD channel_epubkey text NOT NULL DEFAULT ''");
- $r2 = dbq("ALTER TABLE channel ADD channel_eprvkey text NOT NULL DEFAULT ''");
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = dbq("ALTER TABLE channel ADD channel_epubkey text NOT NULL DEFAULT ''");
+ $r2 = dbq("ALTER TABLE channel ADD channel_eprvkey text NOT NULL DEFAULT ''");
+ }
+ else {
+ $r1 = dbq("ALTER TABLE channel ADD channel_epubkey text NOT NULL");
+ $r2 = dbq("ALTER TABLE channel ADD channel_eprvkey text NOT NULL");
+ }
$channels = dbq("select channel_id from channel where true");
if ($channels) {
diff --git a/Zotlabs/Update/_1261.php b/Zotlabs/Update/_1261.php
index f99c49ebd..43fd0b098 100644
--- a/Zotlabs/Update/_1261.php
+++ b/Zotlabs/Update/_1261.php
@@ -20,12 +20,12 @@ class _1261 {
dbq("START TRANSACTION");
- $r1 = dbq("ALTER TABLE xchan ADD xchan_epubkey text NOT NULL DEFAULT ''");
-
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = dbq("ALTER TABLE xchan ADD xchan_epubkey text NOT NULL DEFAULT ''");
$r2 = dbq("ALTER TABLE xchan ADD xchan_updated timestamp NOT NULL DEFAULT '0001-01-01 00:00:00'");
}
else {
+ $r1 = dbq("ALTER TABLE xchan ADD xchan_epubkey text NOT NULL");
$r2 = dbq("ALTER TABLE xchan ADD xchan_updated datetime NOT NULL DEFAULT '0001-01-01 00:00:00'");
}
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 90c6ab7ae..789167938 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -244,17 +244,17 @@ CREATE TABLE "channel" (
"channel_name" text NOT NULL DEFAULT '',
"channel_address" text NOT NULL DEFAULT '',
"channel_guid" text NOT NULL DEFAULT '',
- "channel_guid_sig" text NOT NULL,
+ "channel_guid_sig" text NOT NULL DEFAULT '',
"channel_hash" text NOT NULL DEFAULT '',
"channel_portable_id" text NOT NULL DEFAULT '',
"channel_timezone" varchar(128) NOT NULL DEFAULT 'UTC',
"channel_location" text NOT NULL DEFAULT '',
"channel_theme" text NOT NULL DEFAULT '',
"channel_startpage" text NOT NULL DEFAULT '',
- "channel_pubkey" text NOT NULL,
- "channel_prvkey" text NOT NULL,
- "channel_epubkey" text NOT NULL,
- "channel_eprvkey" text NOT NULL,
+ "channel_pubkey" text NOT NULL DEFAULT '',
+ "channel_prvkey" text NOT NULL DEFAULT '',
+ "channel_epubkey" text NOT NULL DEFAULT '',
+ "channel_eprvkey" text NOT NULL DEFAULT '',
"channel_notifyflags" bigint NOT NULL DEFAULT '65535',
"channel_pageflags" bigint NOT NULL DEFAULT '0',
"channel_dirdate" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
@@ -1241,9 +1241,9 @@ create index "vote_element" on vote ("vote_element");
CREATE TABLE "xchan" (
"xchan_hash" text NOT NULL,
"xchan_guid" text NOT NULL DEFAULT '',
- "xchan_guid_sig" text NOT NULL,
- "xchan_pubkey" text NOT NULL,
- "xchan_epubkey" text NOT NULL,
+ "xchan_guid_sig" text NOT NULL DEFAULT '',
+ "xchan_pubkey" text NOT NULL DEFAULT '',
+ "xchan_epubkey" text NOT NULL DEFAULT '',
"xchan_photo_mimetype" text NOT NULL DEFAULT 'image/jpeg',
"xchan_photo_l" text NOT NULL DEFAULT '',
"xchan_photo_m" text NOT NULL DEFAULT '',