summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2006-02-17 23:49:56 +0000
committerChristian Fowler <spider@viovio.com>2006-02-17 23:49:56 +0000
commit34fde6bd11a6a908de01d3ba33e04ce01543c25f (patch)
treeec0e990945808cf0fe1e42494a629f606e7ce98c
parent950ca2d838596dcb9ba9d06aea73f3f4c3d430b1 (diff)
downloadliberty-34fde6bd11a6a908de01d3ba33e04ce01543c25f.tar.gz
liberty-34fde6bd11a6a908de01d3ba33e04ce01543c25f.tar.bz2
liberty-34fde6bd11a6a908de01d3ba33e04ce01543c25f.zip
rename column size to file_size, remove redundant indices that cause errors on install
-rw-r--r--admin/schema_inc.php1
-rw-r--r--plugins/storage.bitfile.php6
2 files changed, 3 insertions, 4 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index aa6fa46..1beabe1 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -176,7 +176,6 @@ $indices = array (
'attachments_user_id_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'user_id', 'opts' => NULL ),
'attachments_content_id_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'content_id', 'opts' => NULL ),
'st_co_foreign_guid_idx' => array( 'table' => 'liberty_attachments', 'cols' => 'content_id, foreign_id, attachment_plugin_guid', 'opts' => array( 'UNIQUE' ) ),
- 'plugins_guid_idx' => array( 'table' => 'liberty_plugins', 'cols' => 'plugin_guid', 'opts' => array( 'UNIQUE' ) ),
'structures_root_idx' => array( 'table' => 'liberty_structures', 'cols' => 'root_structure_id', 'opts' => NULL),
'structures_parent_idx' => array( 'table' => 'liberty_structures', 'cols' => 'parent_id', 'opts' => NULL),
'structures_content_idx' => array( 'table' => 'liberty_structures', 'cols' => 'content_id', 'opts' => NULL )
diff --git a/plugins/storage.bitfile.php b/plugins/storage.bitfile.php
index 8203cfe..067fb6b 100644
--- a/plugins/storage.bitfile.php
+++ b/plugins/storage.bitfile.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.13 $
+ * @version $Revision: 1.14 $
* @package liberty
* @subpackage plugins_storage
*/
@@ -43,11 +43,11 @@ function bit_files_store( &$pStoreRow ) {
$pref = $gBitSystem->getPreference('centralized_upload_dir');
if( isset( $pref ) ) {
if( !empty( $pStoreRow['foreign_id'] ) ) {
- $sql = "UPDATE `".BIT_DB_PREFIX."liberty_files SET `storage_path`=?, `mime_type`=?, `size`=? WHERE `file_id` = ?";
+ $sql = "UPDATE `".BIT_DB_PREFIX."liberty_files SET `storage_path`=?, `mime_type`=?, `file_size`=? WHERE `file_id` = ?";
$gBitSystem->mDb->query( $sql, array( $pStoreRow['dest_file_path'], $pStoreRow['type'], $pStoreRow['size'], $pStoreRow['foreign_id'] ) );
} else {
$pStoreRow['file_id'] = $gBitSystem->mDb->GenID( 'liberty_files_id_seq' );
- $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_files` ( `storage_path`, `file_id`, `mime_type`, `size`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )";
+ $sql = "INSERT INTO `".BIT_DB_PREFIX."liberty_files` ( `storage_path`, `file_id`, `mime_type`, `file_size`, `user_id` ) VALUES ( ?, ?, ?, ?, ? )";
$userId = !empty( $pStoreRow['upload']['user_id'] ) ? $pStoreRow['upload']['user_id'] : $gBitUser->mUserId;
$gBitSystem->mDb->query($sql, array( $pStoreRow['upload']['dest_path'].$pStoreRow['upload']['name'], $pStoreRow['file_id'], $pStoreRow['upload']['type'], $pStoreRow['upload']['size'], $userId ) );
}