aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-31 17:50:47 -0700
committerredmatrix <git@macgirvin.com>2016-05-31 17:50:47 -0700
commitdfb6255f59980835d364402b372dd39f2b41ee7c (patch)
treef8d97437d713311a9cd3cf13e0e8faa5b617fa8f /install
parent00b4843425371e4ff55c82be577a279e248c29fc (diff)
downloadvolse-hubzilla-dfb6255f59980835d364402b372dd39f2b41ee7c.tar.gz
volse-hubzilla-dfb6255f59980835d364402b372dd39f2b41ee7c.tar.bz2
volse-hubzilla-dfb6255f59980835d364402b372dd39f2b41ee7c.zip
more removal of reserved words from DB schemas
Diffstat (limited to 'install')
-rw-r--r--install/schema_mysql.sql14
-rw-r--r--install/schema_postgres.sql14
-rw-r--r--install/update.php19
3 files changed, 32 insertions, 15 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 63be37f80..2b48afe98 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`)
@@ -1054,7 +1054,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`),
@@ -1064,7 +1064,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`),
@@ -1176,7 +1176,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`),
@@ -1204,13 +1204,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 1ae65068c..05b53e1a3 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")
@@ -1043,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");
@@ -1052,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")
);
@@ -1159,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")
);
@@ -1186,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 0bd8d59f9..4883d6561 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1171 );
+define( 'UPDATE_VERSION' , 1172 );
/**
*
@@ -2146,4 +2146,21 @@ function update_r1170() {
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;
+
+
+
} \ No newline at end of file