diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-18 20:59:46 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-18 20:59:46 +1000 |
| commit | 844a337e03b59c05b2b99cd2085aaec2c0648960 (patch) | |
| tree | a2b4766994c9f31f7d951dd22a093039e7661149 /install.php | |
| parent | 80804b9df603a3bfeb3d2255351fffbaa29ce329 (diff) | |
Make `file` and `thumb` 255 chars
Diffstat (limited to 'install.php')
| -rw-r--r-- | install.php | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/install.php b/install.php index 6971437a..95200459 100644 --- a/install.php +++ b/install.php @@ -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); |
