db update for directory profiles - and fix broken database.sql from the sys_perms addition a couple days back

This commit is contained in:
friendica 2013-12-25 01:22:51 -08:00
parent b1ade138ff
commit 5dee22c94d
3 changed files with 30 additions and 15 deletions

View File

@ -46,7 +46,7 @@ define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
define ( 'DB_UPDATE_VERSION', 1087 );
define ( 'DB_UPDATE_VERSION', 1088 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View File

@ -54,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `account` (
`account_expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`account_expire_notified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`account_service_class` char(32) NOT NULL DEFAULT '',
`account_level` int(10) unsigned NOT NULL DEFAULT 0,
`account_level` int(10) unsigned NOT NULL,
PRIMARY KEY (`account_id`),
KEY `account_email` (`account_email`),
KEY `account_service_class` (`account_service_class`),
@ -848,6 +848,15 @@ CREATE TABLE IF NOT EXISTS `spam` (
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,
`k` char(255) NOT NULL,
`v` mediumtext NOT NULL,
`public_perm` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `term` (
`tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`aid` int(10) unsigned NOT NULL DEFAULT '0',
@ -915,7 +924,7 @@ CREATE TABLE IF NOT EXISTS `verify` (
KEY `token` (`token`),
KEY `meta` (`meta`),
KEY `created` (`created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `vote` (
`vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@ -971,7 +980,7 @@ CREATE TABLE IF NOT EXISTS `xconfig` (
KEY `xchan` (`xchan`),
KEY `cat` (`cat`),
KEY `k` (`k`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `xign` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@ -1008,6 +1017,9 @@ CREATE TABLE IF NOT EXISTS `xprof` (
`xprof_postcode` char(32) NOT NULL DEFAULT '',
`xprof_country` char(255) NOT NULL DEFAULT '',
`xprof_keywords` text NOT NULL,
`xprof_about` text NOT NULL,
`xprof_homepage` char(255) NOT NULL DEFAULT '',
`xprof_hometown` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`xprof_hash`),
KEY `xprof_desc` (`xprof_desc`),
KEY `xprof_dob` (`xprof_dob`),
@ -1018,7 +1030,8 @@ CREATE TABLE IF NOT EXISTS `xprof` (
KEY `xprof_region` (`xprof_region`),
KEY `xprof_postcode` (`xprof_postcode`),
KEY `xprof_country` (`xprof_country`),
KEY `xprof_age` (`xprof_age`)
KEY `xprof_age` (`xprof_age`),
KEY `xprof_hometown` (`xprof_hometown`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `xtag` (
@ -1030,12 +1043,4 @@ CREATE TABLE IF NOT EXISTS `xtag` (
KEY `xtag_term` (`xtag_term`),
KEY `xtag_hash` (`xtag_hash`),
KEY `xtag_flags` (`xtag_flags`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE if not exists `sys_perms` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`cat` CHAR( 255 ) NOT NULL ,
`k` CHAR( 255 ) NOT NULL ,
`v` MEDIUMTEXT NOT NULL,
`public_perm` TINYINT( 1 ) UNSIGNED NOT NULL
) ENGINE = MYISAM DEFAULT CHARSET = utf8");
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

View File

@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1087 );
define( 'UPDATE_VERSION' , 1088 );
/**
*
@ -957,3 +957,13 @@ ADD INDEX ( `account_level` )");
return UPDATE_FAILED;
}
function update_r1087() {
$r = q("ALTER TABLE `xprof` ADD `xprof_about` TEXT NOT NULL DEFAULT '',
ADD `xprof_homepage` CHAR( 255 ) NOT NULL DEFAULT '',
ADD `xprof_hometown` CHAR( 255 ) NOT NULL DEFAULT '',
ADD INDEX ( `xprof_hometown` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}