1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-27 17:00:52 +01:00

Make file and thumb 255 chars

This commit is contained in:
Michael Foster 2013-08-18 20:59:46 +10:00
parent 80804b9df6
commit 844a337e03
2 changed files with 19 additions and 11 deletions

View File

@ -1,7 +1,7 @@
<?php
// Installation/upgrade file
define('VERSION', 'v0.9.6-dev-11');
define('VERSION', 'v0.9.6-dev-12');
require 'inc/functions.php';
@ -23,6 +23,15 @@ if (file_exists($config['has_installed'])) {
if (empty($version))
$version = 'v0.9.1';
function __query($sql) {
sql_open();
if (mysql_version() >= 50503)
return query($sql);
else
return query(str_replace('utf8mb4', 'utf8', $sql));
}
$boards = listBoards();
switch ($version) {
@ -249,14 +258,6 @@ if (file_exists($config['has_installed'])) {
}
}
case 'v0.9.6-dev-9':
sql_open();
function __query($sql) {
if (mysql_version() >= 50503)
return query($sql);
else
return query(str_replace('utf8mb4', 'utf8', $sql));
}
foreach ($boards as &$board) {
__query(sprintf("ALTER TABLE `posts_%s`
CHANGE `subject` `subject` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
@ -356,6 +357,13 @@ if (file_exists($config['has_installed'])) {
CHANGE `boards` `boards` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;") or error(db_error());
query("ALTER TABLE `reports`
CHANGE `board` `board` VARCHAR( 58 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;") or error(db_error());
case 'v0.9.6-dev-11':
foreach ($boards as &$board) {
__query(sprintf("ALTER TABLE `posts_%s`
CHANGE `thumb` `thumb` VARCHAR( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
CHANGE `file` `file` VARCHAR( 255 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL ;",
$board['uri'])) or error(db_error());
}
case false:
// Update version number
file_write($config['has_installed'], VERSION);

View File

@ -10,10 +10,10 @@ CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` (
`body_nomarkup` text,
`time` int(11) NOT NULL,
`bump` int(11) DEFAULT NULL,
`thumb` varchar(50) DEFAULT NULL,
`thumb` varchar(255) DEFAULT NULL,
`thumbwidth` int(11) DEFAULT NULL,
`thumbheight` int(11) DEFAULT NULL,
`file` varchar(50) DEFAULT NULL,
`file` varchar(255) DEFAULT NULL,
`filewidth` int(11) DEFAULT NULL,
`fileheight` int(11) DEFAULT NULL,
`filesize` int(11) DEFAULT NULL,