diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/database.sql | 49 | ||||
-rw-r--r-- | install/update.php | 25 |
2 files changed, 35 insertions, 39 deletions
diff --git a/install/database.sql b/install/database.sql index 0262bce63..24b5a550a 100644 --- a/install/database.sql +++ b/install/database.sql @@ -309,7 +309,6 @@ CREATE TABLE IF NOT EXISTS `fserver` ( `key` text NOT NULL, PRIMARY KEY (`id`), KEY `server` (`server`), - KEY `server_2` (`server`), KEY `posturl` (`posturl`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; @@ -326,43 +325,6 @@ CREATE TABLE IF NOT EXISTS `fsuggest` ( PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE IF NOT EXISTS `gcign` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `uid` int(11) NOT NULL, - `gcid` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `uid` (`uid`), - KEY `gcid` (`gcid`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `gcontact` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` char(255) NOT NULL, - `url` char(255) NOT NULL, - `nurl` char(255) NOT NULL, - `photo` char(255) NOT NULL, - `connect` char(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `nurl` (`nurl`), - KEY `name` (`name`), - KEY `url` (`url`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE IF NOT EXISTS `glink` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `cid` int(11) NOT NULL, - `uid` int(11) NOT NULL, - `gcid` int(11) NOT NULL, - `zcid` int(11) NOT NULL, - `updated` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `cid` (`cid`), - KEY `uid` (`uid`), - KEY `gcid` (`gcid`), - KEY `zcid` (`zcid`), - KEY `updated` (`updated`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - CREATE TABLE IF NOT EXISTS `group` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `hash` char(255) NOT NULL DEFAULT '', @@ -811,6 +773,17 @@ CREATE TABLE IF NOT EXISTS `session` ( KEY `expire` (`expire`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE IF NOT EXISTS `shares` ( + `share_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `share_type` int(11) NOT NULL DEFAULT '0', + `share_target` int(10) unsigned NOT NULL DEFAULT '0', + `share_xchan` char(255) NOT NULL DEFAULT '', + PRIMARY KEY (`share_id`), + KEY `share_type` (`share_type`), + KEY `share_target` (`share_target`), + KEY `share_xchan` (`share_xchan`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `site` ( `site_url` char(255) NOT NULL, `site_flags` int(11) NOT NULL DEFAULT '0', diff --git a/install/update.php b/install/update.php index afb4b08b9..2d06e406a 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1033 ); +define( 'UPDATE_VERSION' , 1034 ); /** * @@ -410,3 +410,26 @@ KEY `xchan` (`xchan`) return UPDATE_SUCCESS; return UPDATE_FAILED; } + +function update_r1033() { + $r = q("CREATE TABLE if not exists `shares` ( +`share_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , +`share_type` INT NOT NULL DEFAULT '0', +`share_target` INT UNSIGNED NOT NULL DEFAULT '0', +`share_xchan` CHAR( 255 ) NOT NULL DEFAULT '', +KEY `share_type` (`share_type`), +KEY `share_target` (`share_target`), +KEY `share_xchan` (`share_xchan`) +) ENGINE = MYISAM DEFAULT CHARSET = utf8"); + + // if these fail don't bother reporting it + + q("drop table gcign"); + q("drop table gcontact"); + q("drop table glink"); + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + |