database cleanup

This commit is contained in:
nobody 2022-02-21 11:59:17 -08:00
parent bf5f494b8f
commit b36d6333d0
3 changed files with 4 additions and 87 deletions

View file

@ -19,6 +19,10 @@ function abook_store_lowlevel($arr)
'abook_channel' => ((array_key_exists('abook_channel', $arr)) ? $arr['abook_channel'] : 0),
'abook_xchan' => ((array_key_exists('abook_xchan', $arr)) ? $arr['abook_xchan'] : ''),
'abook_alias' => ((array_key_exists('abook_alias', $arr)) ? $arr['abook_alias'] : ''),
// The following two fields are not present in existing schema. We need to set them in case
// somebody installs this code over an existing database which has these fields.
// create_table_from_array() will include these fields on codebases which support them,
// and not store them for fresh database which do not.
'abook_my_perms' => ((array_key_exists('abook_my_perms', $arr)) ? $arr['abook_my_perms'] : 0),
'abook_their_perms' => ((array_key_exists('abook_their_perms', $arr)) ? $arr['abook_their_perms'] : 0),
'abook_closeness' => ((array_key_exists('abook_closeness', $arr)) ? $arr['abook_closeness'] : 99),

View file

@ -286,8 +286,6 @@ function xchan_change_key($oldx, $newx, $data)
'item' => 'owner_xchan',
'item' => 'author_xchan',
'item' => 'source_xchan',
'mail' => 'from_xchan',
'mail' => 'to_xchan',
'shares' => 'share_xchan',
'source' => 'src_channel_xchan',
'source' => 'src_xchan',

View file

@ -204,15 +204,6 @@ CREATE TABLE IF NOT EXISTS `attach` (
KEY `os_storage` (`os_storage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `auth_codes` (
`id` varchar(4095) NOT NULL DEFAULT '',
`client_id` varchar(255) NOT NULL DEFAULT '',
`redirect_uri` varchar(512) NOT NULL DEFAULT '',
`expires` int(11) NOT NULL DEFAULT 0 ,
`auth_scope` varchar(512) NOT NULL DEFAULT '',
PRIMARY KEY (`id`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `block` (
`block_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`block_channel_id` int(10) UNSIGNED NOT NULL,
@ -546,23 +537,6 @@ CREATE TABLE IF NOT EXISTS `iconfig` (
KEY `sharing` (`sharing`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `issue` (
`issue_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`issue_created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
`issue_updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
`issue_assigned` varchar(255) NOT NULL DEFAULT '',
`issue_priority` int(11) NOT NULL DEFAULT 0 ,
`issue_status` int(11) NOT NULL DEFAULT 0 ,
`issue_component` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`issue_id`),
KEY `issue_created` (`issue_created`),
KEY `issue_updated` (`issue_updated`),
KEY `issue_assigned` (`issue_assigned`(191)),
KEY `issue_priority` (`issue_priority`),
KEY `issue_status` (`issue_status`),
KEY `issue_component` (`issue_component`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `item` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`mid` varchar(512) NOT NULL DEFAULT '',
@ -1062,29 +1036,6 @@ CREATE TABLE IF NOT EXISTS `session` (
KEY `expire` (`expire`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
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` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`share_id`),
KEY `share_type` (`share_type`),
KEY `share_target` (`share_target`),
KEY `share_xchan` (`share_xchan`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `sign` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`iid` int(10) unsigned NOT NULL DEFAULT 0 ,
`retract_iid` int(10) unsigned NOT NULL DEFAULT 0 ,
`signed_text` mediumtext NOT NULL,
`signature` text NOT NULL,
`signer` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `iid` (`iid`),
KEY `retract_iid` (`retract_iid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `site` (
`site_url` varchar(255) NOT NULL,
`site_access` int(11) NOT NULL DEFAULT 0 ,
@ -1131,15 +1082,6 @@ CREATE TABLE IF NOT EXISTS `source` (
KEY `src_xchan` (`src_xchan`(191))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `sys_perms` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`cat` varchar(255) NOT NULL DEFAULT '',
`k` varchar(255) NOT NULL DEFAULT '',
`v` mediumtext NOT NULL,
`public_perm` tinyint(1) unsigned NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `term` (
`tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`aid` int(10) unsigned NOT NULL DEFAULT 0 ,
@ -1165,19 +1107,6 @@ CREATE TABLE IF NOT EXISTS `term` (
KEY `term_ttype` (`term`,`ttype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `tokens` (
`id` varchar(4096) NOT NULL DEFAULT '',
`secret` text NOT NULL,
`client_id` varchar(255) NOT NULL DEFAULT '',
`expires` bigint(20) unsigned NOT NULL DEFAULT 0 ,
`auth_scope` varchar(1024) NOT NULL DEFAULT '',
`uid` int(11) NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`(191)),
KEY `client_id` (`client_id`(191)),
KEY `expires` (`expires`),
KEY `uid` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `updates` (
`ud_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ud_hash` varchar(255) NOT NULL DEFAULT '',
@ -1210,20 +1139,6 @@ CREATE TABLE IF NOT EXISTS `verify` (
KEY `created` (`created`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `vote` (
`vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`vote_guid` varchar(255) NOT NULL,
`vote_poll` int(11) NOT NULL DEFAULT 0 ,
`vote_element` int(11) NOT NULL DEFAULT 0 ,
`vote_result` text NOT NULL,
`vote_xchan` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`vote_id`),
UNIQUE KEY `vote_vote` (`vote_poll`,`vote_element`,`vote_xchan`(191)),
KEY `vote_guid` (`vote_guid`(191)),
KEY `vote_poll` (`vote_poll`),
KEY `vote_element` (`vote_element`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `xchan` (
`xchan_hash` varchar(255) NOT NULL,
`xchan_guid` varchar(255) NOT NULL DEFAULT '',