mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-27 17:00:52 +01:00
commit
350060e7a6
18
install.php
18
install.php
@ -142,7 +142,7 @@ if (file_exists($config['has_installed'])) {
|
||||
query(sprintf("ALTER TABLE `posts_%s` CHANGE `subject` `subject` VARCHAR( 100 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL", $_board['uri'])) or error(db_error());
|
||||
}
|
||||
case 'v0.9.3-dev-6':
|
||||
// change to MyISAM
|
||||
// change to InnoDB
|
||||
$tables = array(
|
||||
'bans', 'boards', 'ip_notes', 'modlogs', 'mods', 'mutes', 'noticeboard', 'pms', 'reports', 'robot', 'theme_settings', 'news'
|
||||
);
|
||||
@ -151,7 +151,7 @@ if (file_exists($config['has_installed'])) {
|
||||
}
|
||||
|
||||
foreach ($tables as &$table) {
|
||||
query("ALTER TABLE `{$table}` ENGINE = MYISAM DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci") or error(db_error());
|
||||
query("ALTER TABLE `{$table}` ENGINE = INNODB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci") or error(db_error());
|
||||
}
|
||||
case 'v0.9.3-dev-7':
|
||||
foreach ($boards as &$board) {
|
||||
@ -212,7 +212,7 @@ if (file_exists($config['has_installed'])) {
|
||||
foreach ($boards as &$board) {
|
||||
query(sprintf("ALTER TABLE `posts_%s` ADD `body_nomarkup` TEXT NULL AFTER `body`", $board['uri'])) or error(db_error());
|
||||
}
|
||||
query("CREATE TABLE IF NOT EXISTS `cites` ( `board` varchar(8) NOT NULL, `post` int(11) NOT NULL, `target_board` varchar(8) NOT NULL, `target` int(11) NOT NULL, KEY `target` (`target_board`,`target`), KEY `post` (`board`,`post`)) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error());
|
||||
query("CREATE TABLE IF NOT EXISTS `cites` ( `board` varchar(8) NOT NULL, `post` int(11) NOT NULL, `target_board` varchar(8) NOT NULL, `target` int(11) NOT NULL, KEY `target` (`target_board`,`target`), KEY `post` (`board`,`post`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;") or error(db_error());
|
||||
case 'v0.9.5-dev-2':
|
||||
query("ALTER TABLE `boards`
|
||||
CHANGE `uri` `uri` VARCHAR( 15 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
|
||||
@ -235,7 +235,7 @@ if (file_exists($config['has_installed'])) {
|
||||
`passed` smallint(6) NOT NULL,
|
||||
PRIMARY KEY (`hash`),
|
||||
KEY `board` (`board`,`thread`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error());
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;") or error(db_error());
|
||||
case 'v0.9.6-dev-2':
|
||||
query("ALTER TABLE `boards`
|
||||
DROP `id`,
|
||||
@ -462,7 +462,7 @@ if (file_exists($config['has_installed'])) {
|
||||
KEY `posthash` (`posthash`),
|
||||
KEY `filehash` (`filehash`),
|
||||
KEY `time` (`time`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin AUTO_INCREMENT=1 ;") or error(db_error());
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin AUTO_INCREMENT=1 ;") or error(db_error());
|
||||
case 'v0.9.6-dev-19':
|
||||
query("UPDATE ``mods`` SET `type` = 10 WHERE `type` = 0") or error(db_error());
|
||||
query("UPDATE ``mods`` SET `type` = 20 WHERE `type` = 1") or error(db_error());
|
||||
@ -483,7 +483,7 @@ if (file_exists($config['has_installed'])) {
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `expires` (`expires`),
|
||||
KEY `ipstart` (`ipstart`,`ipend`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1") or error(db_error());
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1") or error(db_error());
|
||||
$listquery = query("SELECT * FROM ``bans`` ORDER BY `id`") or error(db_error());
|
||||
while ($ban = $listquery->fetch(PDO::FETCH_ASSOC)) {
|
||||
$query = prepare("INSERT INTO ``bans_new_temp`` VALUES
|
||||
@ -538,7 +538,7 @@ if (file_exists($config['has_installed'])) {
|
||||
`denied` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `ban_id` (`ban_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;") or error(db_error());
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;") or error(db_error());
|
||||
case 'v0.9.6-dev-22':
|
||||
case 'v0.9.6-dev-22 + <a href="https://int.vichan.net/devel/">vichan-devel-4.4.91</a>':
|
||||
case 'v0.9.6-dev-22 + <a href="https://int.vichan.net/devel/">vichan-devel-4.4.92</a>':
|
||||
@ -634,10 +634,10 @@ if (file_exists($config['has_installed'])) {
|
||||
`text` varchar(255),
|
||||
`created_at` int(11),
|
||||
PRIMARY KEY (`cookie`,`extra`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;') or error(db_error());
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;') or error(db_error());
|
||||
case false:
|
||||
// TODO: enhance Tinyboard -> vichan upgrade path.
|
||||
query("CREATE TABLE IF NOT EXISTS ``search_queries`` ( `ip` varchar(39) NOT NULL, `time` int(11) NOT NULL, `query` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error());
|
||||
query("CREATE TABLE IF NOT EXISTS ``search_queries`` ( `ip` varchar(39) NOT NULL, `time` int(11) NOT NULL, `query` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8;") or error(db_error());
|
||||
|
||||
// Update version number
|
||||
file_write($config['has_installed'], VERSION);
|
||||
|
40
install.sql
40
install.sql
@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `antispam` (
|
||||
PRIMARY KEY (`hash`),
|
||||
KEY `board` (`board`,`thread`),
|
||||
KEY `expires` (`expires`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -53,7 +53,7 @@ CREATE TABLE IF NOT EXISTS `bans` (
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `expires` (`expires`),
|
||||
KEY `ipstart` (`ipstart`,`ipend`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -67,7 +67,7 @@ CREATE TABLE IF NOT EXISTS `boards` (
|
||||
`subtitle` tinytext,
|
||||
-- `indexed` boolean default true,
|
||||
PRIMARY KEY (`uri`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
--
|
||||
-- Dumping data for table `boards`
|
||||
@ -89,7 +89,7 @@ CREATE TABLE IF NOT EXISTS `cites` (
|
||||
`target` int(11) NOT NULL,
|
||||
KEY `target` (`target_board`,`target`),
|
||||
KEY `post` (`board`,`post`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -105,7 +105,7 @@ CREATE TABLE IF NOT EXISTS `ip_notes` (
|
||||
`body` text NOT NULL,
|
||||
UNIQUE KEY `id` (`id`),
|
||||
KEY `ip_lookup` (`ip`, `time`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -121,7 +121,7 @@ CREATE TABLE IF NOT EXISTS `modlogs` (
|
||||
`text` text NOT NULL,
|
||||
KEY `time` (`time`),
|
||||
KEY `mod`(`mod`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -138,7 +138,7 @@ CREATE TABLE IF NOT EXISTS `mods` (
|
||||
`boards` text CHARACTER SET utf8 NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `id` (`id`,`username`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
--
|
||||
-- Dumping data for table `mods`
|
||||
@ -157,7 +157,7 @@ CREATE TABLE IF NOT EXISTS `mutes` (
|
||||
`ip` varchar(39) NOT NULL,
|
||||
`time` int(11) NOT NULL,
|
||||
KEY `ip` (`ip`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ascii;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ascii;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -173,7 +173,7 @@ CREATE TABLE IF NOT EXISTS `news` (
|
||||
`body` text NOT NULL,
|
||||
UNIQUE KEY `id` (`id`),
|
||||
KEY `time` (`time`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -189,7 +189,7 @@ CREATE TABLE IF NOT EXISTS `noticeboard` (
|
||||
`body` text NOT NULL,
|
||||
UNIQUE KEY `id` (`id`),
|
||||
KEY `time` (`time`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -206,7 +206,7 @@ CREATE TABLE IF NOT EXISTS `pms` (
|
||||
`unread` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `to` (`to`, `unread`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -222,7 +222,7 @@ CREATE TABLE IF NOT EXISTS `reports` (
|
||||
`post` int(11) NOT NULL,
|
||||
`reason` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -233,7 +233,7 @@ CREATE TABLE IF NOT EXISTS `reports` (
|
||||
CREATE TABLE IF NOT EXISTS `robot` (
|
||||
`hash` varchar(40) COLLATE ascii_bin NOT NULL COMMENT 'SHA1',
|
||||
PRIMARY KEY (`hash`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -245,7 +245,7 @@ CREATE TABLE IF NOT EXISTS `search_queries` (
|
||||
`ip` varchar(39) NOT NULL,
|
||||
`time` int(11) NOT NULL,
|
||||
`query` text NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -258,7 +258,7 @@ CREATE TABLE IF NOT EXISTS `theme_settings` (
|
||||
`name` varchar(40) DEFAULT NULL,
|
||||
`value` text,
|
||||
KEY `theme` (`theme`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -279,7 +279,7 @@ CREATE TABLE IF NOT EXISTS `flood` (
|
||||
KEY `posthash` (`posthash`),
|
||||
KEY `filehash` (`filehash`),
|
||||
KEY `time` (`time`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=ascii COLLATE=ascii_bin AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -295,7 +295,7 @@ CREATE TABLE IF NOT EXISTS `ban_appeals` (
|
||||
`denied` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `ban_id` (`ban_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -312,7 +312,7 @@ CREATE TABLE IF NOT EXISTS `pages` (
|
||||
`content` text,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `u_pages` (`name`,`board`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -330,7 +330,7 @@ CREATE TABLE IF NOT EXISTS `nntp_references` (
|
||||
PRIMARY KEY (`message_id_digest`),
|
||||
UNIQUE KEY `message_id` (`message_id`),
|
||||
UNIQUE KEY `u_board_id` (`board`, `id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -344,7 +344,7 @@ CREATE TABLE IF NOT EXISTS `captchas` (
|
||||
`text` VARCHAR(255),
|
||||
`created_at` INT(11),
|
||||
PRIMARY KEY (`cookie`,`extra`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
|
@ -27,5 +27,5 @@ CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` (
|
||||
KEY `time` (`time`),
|
||||
KEY `ip` (`ip`),
|
||||
KEY `list_threads` (`thread`, `sticky`, `bump`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user