diff options
author | redmatrix <git@macgirvin.com> | 2016-05-31 21:45:33 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-31 21:45:33 -0700 |
commit | b1259876bf398880e7b0c1b44d90f94983243e72 (patch) | |
tree | eb7bacfbb03df6924063c4b9a4cbe04aaccbf483 /install | |
parent | dfb6255f59980835d364402b372dd39f2b41ee7c (diff) | |
download | volse-hubzilla-b1259876bf398880e7b0c1b44d90f94983243e72.tar.gz volse-hubzilla-b1259876bf398880e7b0c1b44d90f94983243e72.tar.bz2 volse-hubzilla-b1259876bf398880e7b0c1b44d90f94983243e72.zip |
more db column renames
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 15 | ||||
-rw-r--r-- | install/schema_postgres.sql | 12 | ||||
-rw-r--r-- | install/update.php | 26 |
3 files changed, 38 insertions, 15 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 2b48afe98..e5bb7b889 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -440,12 +440,13 @@ CREATE TABLE IF NOT EXISTS `groups` ( `uid` int(10) unsigned NOT NULL DEFAULT '0', `visible` tinyint(1) NOT NULL DEFAULT '0', `deleted` tinyint(1) NOT NULL DEFAULT '0', - `name` char(255) NOT NULL DEFAULT '', + `gname` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `uid` (`uid`), KEY `visible` (`visible`), KEY `deleted` (`deleted`), - KEY `hash` (`hash`) + KEY `hash` (`hash`), + KEY `gname` (`gname`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `group_member` ( @@ -979,7 +980,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `profile_name` char(255) NOT NULL DEFAULT '', `is_default` tinyint(1) NOT NULL DEFAULT '0', `hide_friends` tinyint(1) NOT NULL DEFAULT '0', - `name` char(255) NOT NULL DEFAULT '', + `fullname` char(255) NOT NULL DEFAULT '', `pdesc` char(255) NOT NULL DEFAULT '', `chandesc` text NOT NULL, `dob` char(32) NOT NULL DEFAULT '0000-00-00', @@ -992,7 +993,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `hometown` char(255) NOT NULL DEFAULT '', `gender` char(32) NOT NULL DEFAULT '', `marital` char(255) NOT NULL DEFAULT '', - `with` text NOT NULL, + `partner` text NOT NULL, `howlong` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `sexual` char(255) NOT NULL DEFAULT '', `politic` char(255) NOT NULL DEFAULT '', @@ -1008,7 +1009,7 @@ CREATE TABLE IF NOT EXISTS `profile` ( `film` text NOT NULL, `interest` text NOT NULL, `romance` text NOT NULL, - `work` text NOT NULL, + `employment` text NOT NULL, `education` text NOT NULL, `contact` text NOT NULL, `channels` text NOT NULL, @@ -1153,7 +1154,7 @@ CREATE TABLE IF NOT EXISTS `term` ( `uid` int(10) unsigned NOT NULL DEFAULT '0', `oid` int(10) unsigned NOT NULL DEFAULT '0', `otype` tinyint(3) unsigned NOT NULL DEFAULT '0', - `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `ttype` tinyint(3) unsigned NOT NULL DEFAULT '0', `term` char(255) NOT NULL DEFAULT '', `url` char(255) NOT NULL DEFAULT '', `imgurl` char(255) NOT NULL DEFAULT '', @@ -1162,7 +1163,7 @@ CREATE TABLE IF NOT EXISTS `term` ( PRIMARY KEY (`tid`), KEY `oid` (`oid`), KEY `otype` (`otype`), - KEY `type` (`type`), + KEY `ttype` (`ttype`), KEY `term` (`term`), KEY `uid` (`uid`), KEY `aid` (`aid`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 05b53e1a3..bda1b8970 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -445,7 +445,7 @@ CREATE TABLE "groups" ( "uid" bigint NOT NULL, "visible" numeric(1) NOT NULL DEFAULT '0', "deleted" numeric(1) NOT NULL DEFAULT '0', - "name" text NOT NULL, + "gname" text NOT NULL, PRIMARY KEY ("id") ); @@ -968,7 +968,7 @@ CREATE TABLE "profile" ( "profile_name" text NOT NULL, "is_default" numeric(1) NOT NULL DEFAULT '0', "hide_friends" numeric(1) NOT NULL DEFAULT '0', - "name" text NOT NULL, + "fullname" text NOT NULL, "pdesc" text NOT NULL DEFAULT '', "chandesc" text NOT NULL DEFAULT '', "dob" varchar(32) NOT NULL DEFAULT '', @@ -981,7 +981,7 @@ CREATE TABLE "profile" ( "hometown" text NOT NULL DEFAULT '', "gender" varchar(32) NOT NULL DEFAULT '', "marital" text NOT NULL DEFAULT '', - "with" text NOT NULL DEFAULT '', + "partner" text NOT NULL DEFAULT '', "howlong" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', "sexual" text NOT NULL DEFAULT '', "politic" text NOT NULL DEFAULT '', @@ -997,7 +997,7 @@ CREATE TABLE "profile" ( "film" text NOT NULL DEFAULT '', "interest" text NOT NULL DEFAULT '', "romance" text NOT NULL DEFAULT '', - "work" text NOT NULL DEFAULT '', + "employment" text NOT NULL DEFAULT '', "education" text NOT NULL DEFAULT '', "contact" text NOT NULL DEFAULT '', "channels" text NOT NULL DEFAULT '', @@ -1137,7 +1137,7 @@ CREATE TABLE "term" ( "uid" bigint NOT NULL DEFAULT '0', "oid" bigint NOT NULL, "otype" numeric(3) NOT NULL, - "type" numeric(3) NOT NULL, + "ttype" numeric(3) NOT NULL, "term" text NOT NULL, "url" text NOT NULL, "imgurl" text NOT NULL DEFAULT '', @@ -1147,7 +1147,7 @@ CREATE TABLE "term" ( ); create index "term_oid" on term ("oid"); create index "term_otype" on term ("otype"); -create index "term_type" on term ("type"); +create index "term_ttype" on term ("ttype"); create index "term_term" on term ("term"); create index "term_uid" on term ("uid"); create index "term_aid" on term ("aid"); diff --git a/install/update.php b/install/update.php index 4883d6561..dd0131ee8 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1172 ); +define( 'UPDATE_VERSION' , 1173 ); /** * @@ -2163,4 +2163,26 @@ function update_r1171() { -}
\ No newline at end of file +} + +function update_r1172() { + + $r1 = q("ALTER TABLE term CHANGE `type` `ttype` int(3) NOT NULL DEFAULT '0' "); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r2 = q("ALTER TABLE groups CHANGE `name` `gname` TEXT NOT NULL "); + $r3 = q("ALTER TABLE profile CHANGE `name` `fullname` TEXT NOT NULL "); + $r4 = q("ALTER TABLE profile CHANGE `with` `partner` TEXT NOT NULL "); + $r5 = q("ALTER TABLE profile CHANGE `work` `employment` TEXT NOT NULL "); + } + else { + $r2 = q("ALTER TABLE groups CHANGE `name` `gname` char(255) NOT NULL DEFAULT '' "); + $r3 = q("ALTER TABLE profile CHANGE `name` `fullname` char(255) NOT NULL DEFAULT '' "); + $r4 = q("ALTER TABLE profile CHANGE `with` `partner` char(255) NOT NULL DEFAULT '' "); + $r5 = q("ALTER TABLE profile CHANGE `work` `employment` TEXT NOT NULL "); + } + if($r1 && $r2 && $r3 && $r4 && $r5) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} |