aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-19 19:12:33 -0700
committerredmatrix <git@macgirvin.com>2016-06-19 19:12:33 -0700
commitfb61c4fb3497d3751bb43f12cadee9e9c7776be9 (patch)
tree604989e10424456783fccff1fccc5b14da26db7f /install
parentbfaabfb7b5ff639992a01b0e1fc374cd43d536e9 (diff)
parent4578649f758e65f1d87ebb98da7cd891d0b90d0d (diff)
downloadvolse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.tar.gz
volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.tar.bz2
volse-hubzilla-fb61c4fb3497d3751bb43f12cadee9e9c7776be9.zip
Merge branch '1.8RC'
Diffstat (limited to 'install')
-rw-r--r--install/INSTALL.txt17
-rwxr-xr-xinstall/htconfig.sample.php4
-rw-r--r--install/schema_mysql.sql153
-rw-r--r--install/schema_postgres.sql151
-rw-r--r--install/update.php159
5 files changed, 253 insertions, 231 deletions
diff --git a/install/INSTALL.txt b/install/INSTALL.txt
index 18cf4a1db..670ad5af5 100644
--- a/install/INSTALL.txt
+++ b/install/INSTALL.txt
@@ -77,16 +77,15 @@ but may be an issue with nginx or other web server platforms.
Example config scripts are available for these platforms in doc/install.
Apache and nginx have the most support.
- - PHP 5.4 or later. The later the better.
+ - PHP 5.5 or later.
- PHP *command line* access with register_argc_argv set to true in the
php.ini file - and with no hosting provider restrictions on the use of
exec() and proc_open().
- - curl, gd (with at least jpeg and png support), mysqli, mbstring, mcrypt,
- and openssl extensions. The imagick extension is not required but desirable.
-
- - xml extension is required if you want webdav to work.
+ - curl, gd (with at least jpeg and png support), mysqli, mbstring, xml,
+ and openssl extensions. The imagick extension MAY be used instead of gd,
+ but is not required and MAY also be disabled via configuration option.
- some form of email server or email gateway such that PHP mail() works.
@@ -204,17 +203,17 @@ using web forms.
****************************************************************************
****************************************************************************
-8. Set up a cron job or scheduled task to run the poller once every 10-15
-minutes to pick up the recent "public" postings of your friends. Example:
+8. Set up a cron job or scheduled task to run the Cron manager once every 10-15
+minutes to perform background processing and maintenance. Example:
- cd /base/directory; /path/to/php include/poller.php
+ cd /base/directory; /path/to/php Zotlabs/Daemon/Master.php Cron
Change "/base/directory", and "/path/to/php" as appropriate for your situation.
If you are using a Linux server, run "crontab -e" and add a line like the
one shown, substituting for your unique paths and settings:
-*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php include/poller.php
+*/10 * * * * cd /home/myname/mywebsite; /usr/bin/php Zotlabs/Daemon/Master.php Cron
You can generally find the location of PHP by executing "which php". If you
have troubles with this section please contact your hosting provider for
diff --git a/install/htconfig.sample.php b/install/htconfig.sample.php
index 5e506225e..c46805171 100755
--- a/install/htconfig.sample.php
+++ b/install/htconfig.sample.php
@@ -37,11 +37,11 @@ define( 'UNO', 0 );
// Choose a legal default timezone. If you are unsure, use "America/Los_Angeles".
// It can be changed later and only applies to timestamps for anonymous viewers.
-$default_timezone = 'America/Los_Angeles';
+App::$config['system']['timezone'] = 'America/Los_Angeles';
// What is your site name? DO NOT ADD A TRAILING SLASH!
-App::$config['system']['baseurl'] = 'https://myredsite.example';
+App::$config['system']['baseurl'] = 'https://mysite.example';
App::$config['system']['sitename'] = "Hubzilla";
App::$config['system']['location_hash'] = 'if the auto install failed, put a unique random string here';
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 4751106da..a536c3f9a 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -96,15 +96,15 @@ CREATE TABLE IF NOT EXISTS `account` (
CREATE TABLE IF NOT EXISTS `addon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `name` char(255) NOT NULL DEFAULT '',
+ `aname` char(255) NOT NULL DEFAULT '',
`version` char(255) NOT NULL DEFAULT '',
`installed` tinyint(1) NOT NULL DEFAULT '0',
`hidden` tinyint(1) NOT NULL DEFAULT '0',
- `timestamp` bigint(20) NOT NULL DEFAULT '0',
+ `tstamp` bigint(20) NOT NULL DEFAULT '0',
`plugin_admin` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `hidden` (`hidden`),
- KEY `name` (`name`),
+ KEY `aname` (`aname`),
KEY `installed` (`installed`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -158,7 +158,7 @@ CREATE TABLE IF NOT EXISTS `attach` (
`os_storage` tinyint(1) NOT NULL DEFAULT '0',
`os_path` mediumtext NOT NULL,
`display_path` mediumtext NOT NULL,
- `data` longblob NOT NULL,
+ `content` longblob NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`allow_cid` mediumtext NOT NULL,
@@ -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`)
@@ -398,15 +398,15 @@ CREATE TABLE IF NOT EXISTS `event` (
`event_hash` char(255) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `start` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `finish` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `dtstart` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `dtend` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`summary` text NOT NULL,
`description` text NOT NULL,
`location` text NOT NULL,
- `type` char(255) NOT NULL DEFAULT '',
+ `etype` char(255) NOT NULL DEFAULT '',
`nofinish` tinyint(1) NOT NULL DEFAULT '0',
`adjust` tinyint(1) NOT NULL DEFAULT '1',
- `ignore` tinyint(1) NOT NULL DEFAULT '0',
+ `dismissed` tinyint(1) NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -420,12 +420,12 @@ CREATE TABLE IF NOT EXISTS `event` (
`event_vdata` text NOT NULL,
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
- KEY `type` (`type`),
- KEY `start` (`start`),
- KEY `finish` (`finish`),
+ KEY `etype` (`etype`),
+ KEY `dtstart` (`dtstart`),
+ KEY `dtend` (`dtend`),
KEY `adjust` (`adjust`),
KEY `nofinish` (`nofinish`),
- KEY `ignore` (`ignore`),
+ KEY `dismissed` (`dismissed`),
KEY `aid` (`aid`),
KEY `event_hash` (`event_hash`),
KEY `event_xchan` (`event_xchan`),
@@ -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` (
@@ -519,7 +464,7 @@ CREATE TABLE IF NOT EXISTS `hook` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hook` char(255) NOT NULL DEFAULT '',
`file` char(255) NOT NULL DEFAULT '',
- `function` char(255) NOT NULL DEFAULT '',
+ `fn` char(255) NOT NULL DEFAULT '',
`priority` int(11) unsigned NOT NULL DEFAULT '0',
`hook_version` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
@@ -624,7 +569,7 @@ CREATE TABLE IF NOT EXISTS `item` (
`revision` int(10) unsigned NOT NULL DEFAULT '0',
`verb` char(255) NOT NULL DEFAULT '',
`obj_type` char(255) NOT NULL DEFAULT '',
- `object` text NOT NULL,
+ `obj` text NOT NULL,
`tgt_type` char(255) NOT NULL DEFAULT '',
`target` text NOT NULL,
`layout_mid` char(255) NOT NULL DEFAULT '',
@@ -846,24 +791,24 @@ CREATE TABLE IF NOT EXISTS `menu_item` (
CREATE TABLE IF NOT EXISTS `notify` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hash` char(64) NOT NULL DEFAULT '',
- `name` char(255) NOT NULL DEFAULT '',
+ `xname` char(255) NOT NULL DEFAULT '',
`url` char(255) NOT NULL DEFAULT '',
`photo` char(255) NOT NULL DEFAULT '',
- `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`msg` mediumtext NOT NULL,
`aid` int(11) NOT NULL DEFAULT '0',
`uid` int(11) NOT NULL DEFAULT '0',
`link` char(255) NOT NULL DEFAULT '',
`parent` char(255) NOT NULL DEFAULT '',
`seen` tinyint(1) NOT NULL DEFAULT '0',
- `type` int(11) NOT NULL DEFAULT '0',
+ `ntype` int(11) NOT NULL DEFAULT '0',
`verb` char(255) NOT NULL DEFAULT '',
`otype` char(16) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
- KEY `type` (`type`),
+ KEY `ntype` (`ntype`),
KEY `seen` (`seen`),
KEY `uid` (`uid`),
- KEY `date` (`date`),
+ KEY `created` (`created`),
KEY `hash` (`hash`),
KEY `parent` (`parent`),
KEY `link` (`link`),
@@ -883,6 +828,7 @@ CREATE TABLE IF NOT EXISTS `obj` (
`obj_imgurl` char(255) NOT NULL DEFAULT '',
`obj_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`obj_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `obj_quantity` int(11) NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -897,6 +843,7 @@ CREATE TABLE IF NOT EXISTS `obj` (
KEY `obj_imgurl` (`obj_imgurl`),
KEY `obj_created` (`obj_created`),
KEY `obj_edited` (`obj_edited`),
+ KEY `obj_quantity` (`obj_quantity`),
KEY `obj_obj` (`obj_obj`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -946,12 +893,12 @@ CREATE TABLE IF NOT EXISTS `photo` (
`description` text NOT NULL,
`album` char(255) NOT NULL DEFAULT '',
`filename` char(255) NOT NULL DEFAULT '',
- `type` char(128) NOT NULL DEFAULT 'image/jpeg',
+ `mimetype` char(128) NOT NULL DEFAULT 'image/jpeg',
`height` smallint(6) NOT NULL DEFAULT '0',
`width` smallint(6) NOT NULL DEFAULT '0',
- `size` int(10) unsigned NOT NULL DEFAULT '0',
- `data` mediumblob NOT NULL,
- `scale` tinyint(3) NOT NULL DEFAULT '0',
+ `filesize` int(10) unsigned NOT NULL DEFAULT '0',
+ `content` mediumblob NOT NULL,
+ `imgscale` tinyint(3) NOT NULL DEFAULT '0',
`photo_usage` smallint(6) NOT NULL DEFAULT '0',
`profile` tinyint(1) NOT NULL DEFAULT '0',
`is_nsfw` tinyint(1) NOT NULL DEFAULT '0',
@@ -966,13 +913,13 @@ CREATE TABLE IF NOT EXISTS `photo` (
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
KEY `album` (`album`),
- KEY `scale` (`scale`),
+ KEY `imgscale` (`imgscale`),
KEY `profile` (`profile`),
KEY `photo_flags` (`photo_flags`),
- KEY `type` (`type`),
+ KEY `mimetype` (`mimetype`),
KEY `aid` (`aid`),
KEY `xchan` (`xchan`),
- KEY `size` (`size`),
+ KEY `filesize` (`filesize`),
KEY `resource_id` (`resource_id`),
KEY `is_nsfw` (`is_nsfw`),
KEY `os_storage` (`os_storage`),
@@ -1033,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',
@@ -1046,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 '',
@@ -1062,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,
@@ -1108,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`),
@@ -1118,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`),
@@ -1192,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 '',
@@ -1221,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 '',
@@ -1230,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`),
@@ -1244,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`),
@@ -1272,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 75e53d3dd..b637fea43 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -94,16 +94,16 @@ create index "account_level" on account ("account_level");
create index "account_password_changed" on account ("account_password_changed");
CREATE TABLE "addon" (
"id" serial NOT NULL,
- "name" text NOT NULL,
+ "aname" text NOT NULL,
"version" text NOT NULL DEFAULT '0',
"installed" numeric(1) NOT NULL DEFAULT '0',
"hidden" numeric(1) NOT NULL DEFAULT '0',
- "timestamp" numeric(20) NOT NULL DEFAULT '0',
+ "tstamp" numeric(20) NOT NULL DEFAULT '0',
"plugin_admin" numeric(1) NOT NULL DEFAULT '0',
PRIMARY KEY ("id")
);
create index "addon_hidden_idx" on addon ("hidden");
-create index "addon_name_idx" on addon ("name");
+create index "addon_name_idx" on addon ("aname");
create index "addon_installed_idx" on addon ("installed");
CREATE TABLE "app" (
"id" serial NOT NULL,
@@ -154,7 +154,7 @@ CREATE TABLE "attach" (
"os_storage" smallint NOT NULL DEFAULT '0',
"os_path" text NOT NULL,
"display_path" text NOT NULL,
- "data" bytea NOT NULL,
+ "content" bytea NOT NULL,
"created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"allow_cid" text NOT NULL,
@@ -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")
@@ -390,17 +390,17 @@ CREATE TABLE "event" (
"uid" bigint NOT NULL,
"event_xchan" text NOT NULL DEFAULT '',
"event_hash" text NOT NULL DEFAULT '',
- "created" timestamp NOT NULL,
- "edited" timestamp NOT NULL,
- "start" timestamp NOT NULL,
- "finish" timestamp NOT NULL,
+ "created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "dtstart" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "dtend" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"summary" text NOT NULL,
"description" text NOT NULL,
"location" text NOT NULL,
- "type" text NOT NULL,
+ "etype" text NOT NULL,
"nofinish" numeric(1) NOT NULL DEFAULT '0',
"adjust" numeric(1) NOT NULL DEFAULT '1',
- "ignore" numeric(1) NOT NULL DEFAULT '0',
+ "dismissed" numeric(1) NOT NULL DEFAULT '0',
"allow_cid" text NOT NULL,
"allow_gid" text NOT NULL,
"deny_cid" text NOT NULL,
@@ -415,12 +415,12 @@ CREATE TABLE "event" (
PRIMARY KEY ("id")
);
create index "event_uid_idx" on event ("uid");
-create index "event_type_idx" on event ("type");
-create index "event_start_idx" on event ("start");
-create index "event_finish_idx" on event ("finish");
+create index "event_etype_idx" on event ("etype");
+create index "event_dtstart_idx" on event ("dtstart");
+create index "event_dtend_idx" on event ("dtend");
create index "event_adjust_idx" on event ("adjust");
create index "event_nofinish_idx" on event ("nofinish");
-create index "event_ignore_idx" on event ("ignore");
+create index "event_dismissed_idx" on event ("dismissed");
create index "event_aid_idx" on event ("aid");
create index "event_hash_idx" on event ("event_hash");
create index "event_xchan_idx" on event ("event_xchan");
@@ -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")
);
@@ -514,7 +458,7 @@ CREATE TABLE "hook" (
"id" serial NOT NULL,
"hook" text NOT NULL,
"file" text NOT NULL,
- "function" text NOT NULL,
+ "fn" text NOT NULL,
"priority" bigint NOT NULL DEFAULT '0',
"hook_version" smallint NOT NULL DEFAULT '0',
PRIMARY KEY ("id")
@@ -616,7 +560,7 @@ CREATE TABLE "item" (
"revision" bigint NOT NULL DEFAULT '0',
"verb" text NOT NULL DEFAULT '',
"obj_type" text NOT NULL DEFAULT '',
- "object" text NOT NULL,
+ "obj" text NOT NULL,
"tgt_type" text NOT NULL DEFAULT '',
"target" text NOT NULL,
"layout_mid" text NOT NULL DEFAULT '',
@@ -837,25 +781,25 @@ create index "mitem_flags" on menu_item ("mitem_flags");
CREATE TABLE "notify" (
"id" serial NOT NULL,
"hash" char(64) NOT NULL,
- "name" text NOT NULL,
+ "xname" text NOT NULL,
"url" text NOT NULL,
"photo" text NOT NULL,
- "date" timestamp NOT NULL,
+ "created" timestamp NOT NULL,
"msg" text NOT NULL DEFAULT '',
"aid" bigint NOT NULL,
"uid" bigint NOT NULL,
"link" text NOT NULL,
"parent" text NOT NULL DEFAULT '',
"seen" numeric(1) NOT NULL DEFAULT '0',
- "type" bigint NOT NULL,
+ "ntype" bigint NOT NULL,
"verb" text NOT NULL,
"otype" varchar(16) NOT NULL,
PRIMARY KEY ("id")
);
-create index "notify_type" on notify ("type");
+create index "notify_ntype" on notify ("ntype");
create index "notify_seen" on notify ("seen");
create index "notify_uid" on notify ("uid");
-create index "notify_date" on notify ("date");
+create index "notify_created" on notify ("created");
create index "notify_hash" on notify ("hash");
create index "notify_parent" on notify ("parent");
create index "notify_link" on notify ("link");
@@ -873,6 +817,7 @@ CREATE TABLE "obj" (
"obj_imgurl" char(255) NOT NULL DEFAULT '',
"obj_created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"obj_edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "obj_quantity" int(11) NOT NULL DEFAUL '0'.
"allow_cid" text NOT NULL,
"allow_gid" text NOT NULL,
"deny_cid" text NOT NULL,
@@ -890,6 +835,7 @@ create index "obj_url" on obj ("obj_url");
create index "obj_imgurl" on obj ("obj_imgurl");
create index "obj_created" on obj ("obj_created");
create index "obj_edited" on obj ("obj_edited");
+create index "obj_quantity" on obj ("obj_quantity");
CREATE TABLE "outq" (
"outq_hash" text NOT NULL,
@@ -936,12 +882,12 @@ CREATE TABLE "photo" (
"description" text NOT NULL,
"album" text NOT NULL,
"filename" text NOT NULL,
- "type" varchar(128) NOT NULL DEFAULT 'image/jpeg',
+ "mimetype" varchar(128) NOT NULL DEFAULT 'image/jpeg',
"height" numeric(6) NOT NULL,
"width" numeric(6) NOT NULL,
- "size" bigint NOT NULL DEFAULT '0',
- "data" bytea NOT NULL,
- "scale" numeric(3) NOT NULL,
+ "filesize" bigint NOT NULL DEFAULT '0',
+ "content" bytea NOT NULL,
+ "imgscale" numeric(3) NOT NULL DEFAULT '0',
"profile" numeric(1) NOT NULL DEFAULT '0',
"photo_usage" smallint NOT NULL DEFAULT '0',
"is_nsfw" smallint NOT NULL DEFAULT '0',
@@ -957,13 +903,13 @@ CREATE TABLE "photo" (
);
create index "photo_uid" on photo ("uid");
create index "photo_album" on photo ("album");
-create index "photo_scale" on photo ("scale");
+create index "photo_imgscale" on photo ("imgscale");
create index "photo_profile" on photo ("profile");
create index "photo_flags" on photo ("photo_flags");
create index "photo_type" on photo ("type");
create index "photo_aid" on photo ("aid");
create index "photo_xchan" on photo ("xchan");
-create index "photo_size" on photo ("size");
+create index "photo_filesize" on photo ("filesize");
create index "photo_resource_id" on photo ("resource_id");
create index "photo_usage" on photo ("photo_usage");
create index "photo_is_nsfw" on photo ("is_nsfw");
@@ -1022,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 '',
@@ -1035,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 '',
@@ -1051,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 '',
@@ -1097,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");
@@ -1106,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")
);
@@ -1177,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,
@@ -1204,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 '',
@@ -1214,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");
@@ -1226,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")
);
@@ -1253,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 ea1bd8bc7..908f60498 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1168 );
+define( 'UPDATE_VERSION' , 1176 );
/**
*
@@ -2097,3 +2097,160 @@ function update_r1167() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1168() {
+
+ $r1 = q("alter table obj add obj_quantity int not null default '0' ");
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r2 = q("create index \"obj_quantity_idx\" on obj (\"obj_quantity\") ");
+ }
+ else {
+ $r2 = q("alter table obj add index ( obj_quantity ) ");
+ }
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1169() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE `addon` CHANGE `timestamp` `tstamp` numeric( 20 ) UNSIGNED NOT NULL DEFAULT '0' ");
+ $r2 = q("ALTER TABLE `addon` CHANGE `name` `aname` text NOT NULL DEFAULT '' ");
+ $r3 = q("ALTER TABLE `hook` CHANGE `function` `fn` text NOT NULL DEFAULT '' ");
+
+ }
+ else {
+ $r1 = q("ALTER TABLE `addon` CHANGE `timestamp` `tstamp` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT '0' ");
+ $r2 = q("ALTER TABLE `addon` CHANGE `name` `aname` CHAR(255) NOT NULL DEFAULT '' ");
+ $r3 = q("ALTER TABLE `hook` CHANGE `function` `fn` CHAR(255) NOT NULL DEFAULT '' ");
+ }
+
+ if($r1 && $r2 && $r3)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+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;
+
+}
+
+function update_r1173() {
+
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE notify CHANGE `name` `xname` TEXT NOT NULL ");
+ $r2 = q("ALTER TABLE notify CHANGE `date` `created` timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' ");
+ $r3 = q("ALTER TABLE notify CHANGE `type` `ntype` numeric(3) NOT NULL DEFAULT '0' ");
+ }
+ else {
+ $r1 = q("ALTER TABLE notify CHANGE `name` `xname` char(255) NOT NULL DEFAULT '' ");
+ $r2 = q("ALTER TABLE notify CHANGE `date` `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ");
+ $r3 = q("ALTER TABLE notify CHANGE `type` `ntype` smallint(3) NOT NULL DEFAULT '0' ");
+ }
+
+ if($r1 && $r2 && $r3)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+function update_r1174() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE event CHANGE `type` `etype` varchar(255) NOT NULL DEFAULT '' ");
+ $r2 = q("ALTER TABLE event CHANGE `start` `dtstart` timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' ");
+ $r3 = q("ALTER TABLE event CHANGE `finish` `dtend` timestamp NOT NULL DEFAULT '0001-01-01 00:00:00' ");
+ $r4 = q("ALTER TABLE event CHANGE `ignore` `dismissed` numeric(1) NOT NULL DEFAULT '0' ");
+ $r5 = q("ALTER TABLE attach CHANGE `data` `content` bytea NOT NULL ");
+ $r6 = q("ALTER TABLE photo CHANGE `data` `content` bytea NOT NULL ");
+ }
+ else {
+ $r1 = q("ALTER TABLE event CHANGE `type` `etype` char(255) NOT NULL DEFAULT '' ");
+ $r2 = q("ALTER TABLE event CHANGE `start` `dtstart` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ");
+ $r3 = q("ALTER TABLE event CHANGE `finish` `dtend` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' ");
+ $r4 = q("ALTER TABLE event CHANGE `ignore` `dismissed` tinyint(1) NOT NULL DEFAULT '0' ");
+ $r5 = q("ALTER TABLE attach CHANGE `data` `content` longblob NOT NULL ");
+ $r6 = q("ALTER TABLE photo CHANGE `data` `content` mediumblob NOT NULL ");
+ }
+
+ if($r1 && $r2 && $r3 && $r4 && $r5 && $r6)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+function update_r1175() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE item CHANGE `object` `obj` text NOT NULL");
+ $r2 = q("ALTER TABLE photo CHANGE `size` `filesize` bigint NOT NULL DEFAULT '0' ");
+ $r3 = q("ALTER TABLE photo CHANGE `scale` `imgscale` numeric(3) NOT NULL DEFAULT '0' ");
+ $r4 = q("ALTER TABLE photo CHANGE `type` `mimetype` varchar(128) NOT NULL DEFAULT 'image/jpeg' ");
+
+ }
+ else {
+ $r1 = q("ALTER TABLE item CHANGE `object` `obj` text NOT NULL");
+ $r2 = q("ALTER TABLE photo CHANGE `size` `filesize` int(10) unsigned NOT NULL DEFAULT '0' ");
+ $r3 = q("ALTER TABLE photo CHANGE `scale` `imgscale` tinyint(3) unsigned NOT NULL DEFAULT '0' ");
+ $r4 = q("ALTER TABLE photo CHANGE `type` `mimetype` char(128) NOT NULL DEFAULT 'image/jpeg' ");
+
+ }
+
+ if($r1 && $r2 && $r3 && $r4)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}