aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-24 16:59:50 -0800
committerredmatrix <git@macgirvin.com>2016-02-24 17:00:16 -0800
commit6300f47cdcd921141b8f98b71d373d53aa3d80f2 (patch)
tree4eff5f2dbcd3fbe78e55726186534091832ebf6a
parent2b95580cc006b410c8df7b71846872b0defba68d (diff)
downloadvolse-hubzilla-6300f47cdcd921141b8f98b71d373d53aa3d80f2.tar.gz
volse-hubzilla-6300f47cdcd921141b8f98b71d373d53aa3d80f2.tar.bz2
volse-hubzilla-6300f47cdcd921141b8f98b71d373d53aa3d80f2.zip
schema change to support channel move (a completely different operation than channel clone)
-rwxr-xr-xboot.php2
-rw-r--r--install/schema_mysql.sql4
-rw-r--r--install/schema_postgres.sql2
-rw-r--r--install/update.php17
-rw-r--r--view/en-au/update_fail_eml.tpl2
5 files changed, 23 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index f1c7d8951..7610f16d8 100755
--- a/boot.php
+++ b/boot.php
@@ -50,7 +50,7 @@ define ( 'RED_VERSION', trim(file_get_contents('version.inc')));
define ( 'STD_VERSION', '1.2.4' );
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1163 );
+define ( 'DB_UPDATE_VERSION', 1164 );
/**
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 161c174e5..07a88cf0a 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -230,6 +230,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
`channel_w_like` int(10) unsigned NOT NULL DEFAULT '0',
`channel_removed` tinyint(1) NOT NULL DEFAULT '0',
`channel_system` tinyint(1) NOT NULL DEFAULT '0',
+ `channel_moved` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`channel_id`),
UNIQUE KEY `channel_address_unique` (`channel_address`),
KEY `channel_account_id` (`channel_account_id`),
@@ -268,7 +269,8 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_w_like` (`channel_w_like`),
KEY `channel_removed` (`channel_removed`),
KEY `channel_system` (`channel_system`),
- KEY `channel_lastpost` (`channel_lastpost`)
+ KEY `channel_lastpost` (`channel_lastpost`),
+ KEY `channel_moved` (`channel_moved`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `chat` (
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 964ca5966..3302ef6c0 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -225,6 +225,7 @@ CREATE TABLE "channel" (
"channel_w_like" bigint NOT NULL DEFAULT '128',
"channel_removed" smallint NOT NULL DEFAULT '0',
"channel_system" smallint NOT NULL DEFAULT '0',
+ "channel_moved" text NOT NULL DEFAULT '',
PRIMARY KEY ("channel_id"),
UNIQUE ("channel_address")
);
@@ -265,6 +266,7 @@ create index "channel_dirdate" on channel ("channel_dirdate");
create index "channel_lastpost" on channel ("channel_lastpost");
create index "channel_removed" on channel ("channel_removed");
create index "channel_system" on channel ("channel_system");
+create index "channel_moved" on channel ("channel_moved");
CREATE TABLE "chat" (
"chat_id" serial NOT NULL,
"chat_room" bigint NOT NULL DEFAULT '0',
diff --git a/install/update.php b/install/update.php
index d21295be7..0f9b3ab28 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1163 );
+define( 'UPDATE_VERSION' , 1164 );
/**
*
@@ -2003,4 +2003,19 @@ function update_r1162() {
if($r1 && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
+}
+
+function update_r1163() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("alter table channel add channel_moved text not null default '' ");
+ $r2 = q("create index \"channel_channel_moved\" on channel (\"channel_moved\") ");
+ }
+ else {
+ $r1 = q("alter table channel add channel_moved char(255) not null default '' ");
+ $r2 = q("alter table channel add index ( channel_moved ) ");
+ }
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
} \ No newline at end of file
diff --git a/view/en-au/update_fail_eml.tpl b/view/en-au/update_fail_eml.tpl
index 61f44b1e6..86bb61aaa 100644
--- a/view/en-au/update_fail_eml.tpl
+++ b/view/en-au/update_fail_eml.tpl
@@ -4,7 +4,7 @@ I'm the web server at {{$sitename}};
The Hubzilla developers released update {{$update}} recently,
but when I tried to install it, something went terribly wrong.
This needs to be fixed soon and it requires human intervention.
-Please contact a Red developer if you can not figure out how to
+Please contact a project developer if you can not figure out how to
fix it on your own. My database might be invalid.
The error message is '{{$error}}'.