diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-06-01 09:15:56 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-06-01 09:15:56 +0200 |
commit | c1039977f1d64611d2c793f3aded96d031b74183 (patch) | |
tree | fa32a8f59c863564998cd149a902388dd363d605 /install | |
parent | 316fee93f7f7df92db514de961b74a71556fdb63 (diff) | |
parent | b1259876bf398880e7b0c1b44d90f94983243e72 (diff) | |
download | volse-hubzilla-c1039977f1d64611d2c793f3aded96d031b74183.tar.gz volse-hubzilla-c1039977f1d64611d2c793f3aded96d031b74183.tar.bz2 volse-hubzilla-c1039977f1d64611d2c793f3aded96d031b74183.zip |
Merge branch 'dev' into sabre32
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 99 | ||||
-rw-r--r-- | install/schema_postgres.sql | 95 | ||||
-rw-r--r-- | install/update.php | 58 |
3 files changed, 84 insertions, 168 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 68b739f7a..e5bb7b889 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -188,7 +188,7 @@ CREATE TABLE IF NOT EXISTS `auth_codes` ( `client_id` varchar(20) NOT NULL DEFAULT '', `redirect_uri` varchar(200) NOT NULL DEFAULT '', `expires` int(11) NOT NULL DEFAULT '0', - `scope` varchar(250) NOT NULL DEFAULT '', + `auth_scope` varchar(512) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -342,7 +342,7 @@ CREATE TABLE IF NOT EXISTS `clients` ( `client_id` varchar(20) NOT NULL DEFAULT '', `pw` varchar(20) NOT NULL DEFAULT '', `redirect_uri` varchar(200) NOT NULL DEFAULT '', - `name` text, + `clname` text, `icon` text, `uid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`client_id`) @@ -434,74 +434,19 @@ CREATE TABLE IF NOT EXISTS `event` ( KEY `event_priority` (`event_priority`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `fcontact` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `url` char(255) NOT NULL, - `name` char(255) NOT NULL, - `photo` char(255) NOT NULL, - `request` char(255) NOT NULL, - `nick` char(255) NOT NULL, - `addr` char(255) NOT NULL, - `batch` char(255) NOT NULL, - `notify` char(255) NOT NULL, - `poll` char(255) NOT NULL, - `confirm` char(255) NOT NULL, - `priority` tinyint(1) NOT NULL, - `network` char(32) NOT NULL, - `alias` char(255) NOT NULL, - `pubkey` text NOT NULL, - `updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`id`), - KEY `addr` (`addr`), - KEY `network` (`network`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `ffinder` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `uid` int(10) unsigned NOT NULL, - `cid` int(10) unsigned NOT NULL, - `fid` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `uid` (`uid`), - KEY `cid` (`cid`), - KEY `fid` (`fid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `fserver` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `server` char(255) NOT NULL DEFAULT '', - `posturl` char(255) NOT NULL DEFAULT '', - `key` text NOT NULL, - PRIMARY KEY (`id`), - KEY `server` (`server`), - KEY `posturl` (`posturl`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `fsuggest` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uid` int(11) NOT NULL DEFAULT '0', - `cid` int(11) NOT NULL DEFAULT '0', - `name` char(255) NOT NULL DEFAULT '', - `url` char(255) NOT NULL DEFAULT '', - `request` char(255) NOT NULL DEFAULT '', - `photo` char(255) NOT NULL DEFAULT '', - `note` text NOT NULL, - `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `groups` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `hash` char(255) NOT NULL DEFAULT '', `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` ( @@ -1035,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', @@ -1048,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 '', @@ -1064,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, @@ -1110,7 +1055,7 @@ CREATE TABLE IF NOT EXISTS `register` ( `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `uid` int(10) unsigned NOT NULL DEFAULT '0', `password` char(255) NOT NULL DEFAULT '', - `language` char(16) NOT NULL DEFAULT '', + `lang` char(16) NOT NULL DEFAULT '', PRIMARY KEY (`id`), KEY `hash` (`hash`), KEY `created` (`created`), @@ -1120,7 +1065,7 @@ CREATE TABLE IF NOT EXISTS `register` ( CREATE TABLE IF NOT EXISTS `session` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `sid` char(255) NOT NULL DEFAULT '', - `data` text NOT NULL, + `sess_data` text NOT NULL, `expire` bigint(20) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `sid` (`sid`), @@ -1194,20 +1139,6 @@ CREATE TABLE IF NOT EXISTS `source` ( KEY `src_xchan` (`src_xchan`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `spam` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uid` int(11) NOT NULL DEFAULT '0', - `spam` int(11) NOT NULL DEFAULT '0', - `ham` int(11) NOT NULL DEFAULT '0', - `term` char(255) NOT NULL DEFAULT '', - `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - PRIMARY KEY (`id`), - KEY `uid` (`uid`), - KEY `spam` (`spam`), - KEY `ham` (`ham`), - KEY `term` (`term`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `sys_perms` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `cat` char(255) NOT NULL DEFAULT '', @@ -1223,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 '', @@ -1232,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`), @@ -1246,7 +1177,7 @@ CREATE TABLE IF NOT EXISTS `tokens` ( `secret` text NOT NULL, `client_id` varchar(20) NOT NULL DEFAULT '', `expires` bigint(20) unsigned NOT NULL DEFAULT '0', - `scope` varchar(200) NOT NULL DEFAULT '', + `auth_scope` varchar(512) NOT NULL DEFAULT '', `uid` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `client_id` (`client_id`), @@ -1274,13 +1205,13 @@ CREATE TABLE IF NOT EXISTS `updates` ( CREATE TABLE IF NOT EXISTS `verify` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `channel` int(10) unsigned NOT NULL DEFAULT '0', - `type` char(32) NOT NULL DEFAULT '', + `vtype` char(32) NOT NULL DEFAULT '', `token` char(255) NOT NULL DEFAULT '', `meta` char(255) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), KEY `channel` (`channel`), - KEY `type` (`type`), + KEY `vtype` (`vtype`), KEY `token` (`token`), KEY `meta` (`meta`), KEY `created` (`created`) diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 76a3a013e..bda1b8970 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -184,7 +184,7 @@ CREATE TABLE "auth_codes" ( "client_id" varchar(20) NOT NULL, "redirect_uri" varchar(200) NOT NULL, "expires" bigint NOT NULL, - "scope" varchar(250) NOT NULL, + "auth_scope" varchar(512) NOT NULL, PRIMARY KEY ("id") ); CREATE TABLE "cache" ( @@ -333,7 +333,7 @@ CREATE TABLE "clients" ( "client_id" varchar(20) NOT NULL, "pw" varchar(20) NOT NULL, "redirect_uri" varchar(200) NOT NULL, - "name" text, + "clname" text, "icon" text, "uid" bigint NOT NULL DEFAULT '0', PRIMARY KEY ("client_id") @@ -428,62 +428,6 @@ create index "event_status_idx" on event ("event_status"); create index "event_sequence_idx" on event ("event_sequence"); create index "event_priority_idx" on event ("event_priority"); - -CREATE TABLE "fcontact" ( - "id" serial NOT NULL, - "url" text NOT NULL, - "name" text NOT NULL, - "photo" text NOT NULL, - "request" text NOT NULL, - "nick" text NOT NULL, - "addr" text NOT NULL, - "batch" text NOT NULL, - "notify" text NOT NULL, - "poll" text NOT NULL, - "confirm" text NOT NULL, - "priority" numeric(1) NOT NULL, - "network" varchar(32) NOT NULL DEFAULT '', - "alias" text NOT NULL, - "pubkey" text NOT NULL, - "updated" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - PRIMARY KEY ("id") -); -create index "fcontact_addr_idx" on fcontact ("addr"); -create index "fcontact_network_idx" on fcontact ("network"); - -CREATE TABLE "ffinder" ( - "id" serial NOT NULL, - "uid" bigint NOT NULL, - "cid" bigint NOT NULL, - "fid" bigint NOT NULL, - PRIMARY KEY ("id") -); -create index "ffinder_uid_idx" on ffinder ("uid"); -create index "ffinder_cid_idx" on ffinder ("cid"); -create index "ffinder_fid_idx" on ffinder ("fid"); - -CREATE TABLE "fserver" ( - "id" serial NOT NULL, - "server" text NOT NULL, - "posturl" text NOT NULL, - "key" text NOT NULL, - PRIMARY KEY ("id") -); -create index "fserver_server_idx" on fserver ("server"); -create index "fserver_posturl_idx" on fserver ("posturl"); - -CREATE TABLE "fsuggest" ( - "id" serial NOT NULL, - "uid" bigint NOT NULL, - "cid" bigint NOT NULL, - "name" text NOT NULL, - "url" text NOT NULL, - "request" text NOT NULL, - "photo" text NOT NULL, - "note" text NOT NULL, - "created" timestamp NOT NULL, - PRIMARY KEY ("id") -); CREATE TABLE "group_member" ( "id" serial NOT NULL, "uid" bigint NOT NULL, @@ -501,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") ); @@ -1024,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 '', @@ -1037,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 '', @@ -1053,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 '', @@ -1099,7 +1043,7 @@ CREATE TABLE "register" ( "created" timestamp NOT NULL, "uid" bigint NOT NULL, "password" text NOT NULL, - "language" varchar(16) NOT NULL, + "lang" varchar(16) NOT NULL, PRIMARY KEY ("id") ); create index "reg_hash" on register ("hash"); @@ -1108,7 +1052,7 @@ create index "reg_uid" on register ("uid"); CREATE TABLE "session" ( "id" serial, "sid" text NOT NULL, - "data" text NOT NULL, + "sess_data" text NOT NULL, "expire" numeric(20) NOT NULL, PRIMARY KEY ("id") ); @@ -1179,19 +1123,6 @@ CREATE TABLE "source" ( create index "src_channel_id" on "source" ("src_channel_id"); create index "src_channel_xchan" on "source" ("src_channel_xchan"); create index "src_xchan" on "source" ("src_xchan"); -CREATE TABLE "spam" ( - "id" serial NOT NULL, - "uid" bigint NOT NULL, - "spam" bigint NOT NULL DEFAULT '0', - "ham" bigint NOT NULL DEFAULT '0', - "term" text NOT NULL, - "date" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - PRIMARY KEY ("id") -); -create index "spam_uid" on spam ("uid"); -create index "spam_spam" on spam ("spam"); -create index "spam_ham" on spam ("ham"); -create index "spam_term" on spam ("term"); CREATE TABLE "sys_perms" ( "id" serial NOT NULL, "cat" text NOT NULL, @@ -1206,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 '', @@ -1216,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"); @@ -1228,7 +1159,7 @@ CREATE TABLE "tokens" ( "secret" text NOT NULL, "client_id" varchar(20) NOT NULL, "expires" numeric(20) NOT NULL, - "scope" varchar(200) NOT NULL, + "auth_scope" varchar(512) NOT NULL, "uid" bigint NOT NULL, PRIMARY KEY ("id") ); @@ -1255,14 +1186,14 @@ create index "ud_last" on updates ("ud_last"); CREATE TABLE "verify" ( "id" serial NOT NULL, "channel" bigint NOT NULL DEFAULT '0', - "type" varchar(32) NOT NULL DEFAULT '', + "vtype" varchar(32) NOT NULL DEFAULT '', "token" text NOT NULL DEFAULT '', "meta" text NOT NULL DEFAULT '', "created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY ("id") ); create index "verify_channel" on verify ("channel"); -create index "verify_type" on verify ("type"); +create index "verify_vtype" on verify ("vtype"); create index "verify_token" on verify ("token"); create index "verify_meta" on verify ("meta"); create index "verify_created" on verify ("created"); diff --git a/install/update.php b/install/update.php index 686c199b5..dd0131ee8 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1170 ); +define( 'UPDATE_VERSION' , 1173 ); /** * @@ -2131,4 +2131,58 @@ function update_r1169() { if($r1 && $r2 && $r3) return UPDATE_SUCCESS; return UPDATE_FAILED; -}
\ No newline at end of file +} + + +function update_r1170() { + + $r1 = q("drop table fcontact"); + $r2 = q("drop table ffinder"); + $r3 = q("drop table fserver"); + $r4 = q("drop table fsuggest"); + $r5 = q("drop table spam"); + + if($r1 && $r2 && $r3 && $r4 && $r5) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} + +function update_r1171() { + + $r1 = q("ALTER TABLE verify CHANGE `type` `vtype` varchar(32) NOT NULL DEFAULT '' "); + $r2 = q("ALTER TABLE tokens CHANGE `scope` `auth_scope` varchar(512) NOT NULL DEFAULT '' "); + $r3 = q("ALTER TABLE auth_codes CHANGE `scope` `auth_scope` varchar(512) NOT NULL DEFAULT '' "); + $r4 = q("ALTER TABLE clients CHANGE `name` `clname` TEXT "); + $r5 = q("ALTER TABLE session CHANGE `data` `sess_data` TEXT NOT NULL "); + $r6 = q("ALTER TABLE register CHANGE `language` `lang` varchar(16) NOT NULL DEFAULT '' "); + + if($r1 && $r2 && $r3 && $r4 && $r5 && $r6) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + + + +} + +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; + +} |