aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/database.sql9
-rw-r--r--install/update.php11
2 files changed, 18 insertions, 2 deletions
diff --git a/install/database.sql b/install/database.sql
index 17d71e7af..a16979757 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -84,6 +84,7 @@ CREATE TABLE IF NOT EXISTS `attach` (
`filename` char(255) NOT NULL DEFAULT '',
`filetype` char(64) NOT NULL DEFAULT '',
`filesize` int(10) unsigned NOT NULL DEFAULT '0',
+ `revision` int(10) unsigned NOT NULL DEFAULT '0',
`data` longblob NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -99,7 +100,13 @@ CREATE TABLE IF NOT EXISTS `attach` (
KEY `filetype` (`filetype`),
KEY `filesize` (`filesize`),
KEY `created` (`created`),
- KEY `edited` (`edited`)
+ KEY `edited` (`edited`),
+ KEY `filename_2` (`filename`),
+ KEY `filetype_2` (`filetype`),
+ KEY `filesize_2` (`filesize`),
+ KEY `created_2` (`created`),
+ KEY `edited_2` (`edited`),
+ KEY `revision` (`revision`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `auth_codes` (
diff --git a/install/update.php b/install/update.php
index 7eb7d719f..fa428b135 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1024 );
+define( 'UPDATE_VERSION' , 1025 );
/**
*
@@ -316,3 +316,12 @@ function update_r1023() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1024() {
+ $r = q("ALTER TABLE `attach` ADD `revision` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `filesize` ,
+ADD INDEX ( `revision` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+