aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-31 16:13:44 -0800
committerfriendica <info@friendica.com>2013-01-31 16:13:44 -0800
commit02e099da455f0ca42720e60eabe65ba8d4560373 (patch)
tree51ca9749aa9c67fc3a161e62eff121e9b51a34ae /install
parenta72c16c7c0c7a0b8fc0aaf5fbda78291e85cd054 (diff)
downloadvolse-hubzilla-02e099da455f0ca42720e60eabe65ba8d4560373.tar.gz
volse-hubzilla-02e099da455f0ca42720e60eabe65ba8d4560373.tar.bz2
volse-hubzilla-02e099da455f0ca42720e60eabe65ba8d4560373.zip
file/attachment storage api with revision control - needs a bit more testing but the framework is in place
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;
+}
+