mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
SQL 예약어와 충돌하는 type 컬럼명을 mime_type으로 변경
This commit is contained in:
parent
805a7324cc
commit
4dffddc1d1
4 changed files with 15 additions and 15 deletions
|
|
@ -89,7 +89,7 @@ class file extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'type'))
|
||||
if(!$oDB->isColumnExists('files', 'mime_type'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -188,14 +188,14 @@ class file extends ModuleObject
|
|||
{
|
||||
$oDB->addColumn('files', 'thumbnail_filename', 'varchar', '250', null, false, 'uploaded_filename');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'type'))
|
||||
if(!$oDB->isColumnExists('files', 'mime_type'))
|
||||
{
|
||||
$oDB->addColumn('files', 'type', 'varchar', '60', '', true, 'thumbnail_filename');
|
||||
$oDB->addIndex('files', 'idx_type', 'type');
|
||||
$oDB->addColumn('files', 'mime_type', 'varchar', '60', '', true, 'file_size');
|
||||
$oDB->addIndex('files', 'idx_mime_type', 'mime_type');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'original_type'))
|
||||
{
|
||||
$oDB->addColumn('files', 'original_type', 'varchar', '60', null, false, 'type');
|
||||
$oDB->addColumn('files', 'original_type', 'varchar', '60', null, false, 'mime_type');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'width'))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -955,14 +955,14 @@ class fileController extends file
|
|||
$args->member_srl = Rhymix\Framework\Session::getMemberSrl();
|
||||
$args->source_filename = $file_info['name'];
|
||||
$args->sid = Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||
$args->type = $file_info['type'];
|
||||
$args->mime_type = $file_info['type'];
|
||||
$args->width = $file_info['width'];
|
||||
$args->height = $file_info['height'];
|
||||
$args->duration = $file_info['duration'];
|
||||
|
||||
// Set original type if file type is changed
|
||||
$args->original_type = null;
|
||||
if($args->type !== $file_info['original_type'])
|
||||
if($args->mime_type !== $file_info['original_type'])
|
||||
{
|
||||
$args->original_type = $file_info['original_type'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,22 +7,22 @@
|
|||
<column name="upload_target_srl" var="upload_target_srl" filter="number" default="0" notnull="notnull" />
|
||||
<column name="sid" var="sid" />
|
||||
<column name="module_srl" var="module_srl" filter="number" default="0" notnull="notnull" />
|
||||
<column name="member_srl" var="member_srl" default="0" />
|
||||
<column name="download_count" var="download_count" default="0" />
|
||||
<column name="direct_download" var="direct_download" notnull="notnull" default="N" />
|
||||
<column name="source_filename" var="source_filename" notnull="notnull" minlength="1" maxlength="250" />
|
||||
<column name="uploaded_filename" var="uploaded_filename" notnull="notnull" minlength="1" maxlength="250" />
|
||||
<column name="thumbnail_filename" var="thumbnail_filename" />
|
||||
<column name="type" var="type" notnull="notnull" />
|
||||
<column name="file_size" var="file_size" notnull="notnull" default="0" />
|
||||
<column name="mime_type" var="mime_type" notnull="notnull" />
|
||||
<column name="original_type" var="original_type" />
|
||||
<column name="width" var="width" />
|
||||
<column name="height" var="height" />
|
||||
<column name="duration" var="duration" />
|
||||
<column name="file_size" var="file_size" notnull="notnull" default="0" />
|
||||
<column name="direct_download" var="direct_download" notnull="notnull" default="N" />
|
||||
<column name="comment" var="comment" />
|
||||
<column name="download_count" var="download_count" default="0" />
|
||||
<column name="member_srl" var="member_srl" default="0" />
|
||||
<column name="isvalid" var="isvalid" default="N" />
|
||||
<column name="cover_image" var="is_cover" default="N" />
|
||||
<column name="regdate" var="regdate" default="curdate()" />
|
||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||
<column name="isvalid" var="isvalid" default="N" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@
|
|||
<column name="source_filename" type="varchar" size="250" />
|
||||
<column name="uploaded_filename" type="varchar" size="250" />
|
||||
<column name="thumbnail_filename" type="varchar" size="250" />
|
||||
<column name="type" type="varchar" size="60" notnull="notnull" index="idx_type" />
|
||||
<column name="file_size" type="number" size="11" default="0" notnull="notnull" index="idx_file_size" />
|
||||
<column name="mime_type" type="varchar" size="60" notnull="notnull" index="idx_mime_type" />
|
||||
<column name="original_type" type="varchar" size="60" />
|
||||
<column name="width" type="number" size="11" />
|
||||
<column name="height" type="number" size="11" />
|
||||
<column name="duration" type="number" size="11" />
|
||||
<column name="file_size" type="number" size="11" default="0" notnull="notnull" index="idx_file_size" />
|
||||
<column name="comment" type="varchar" size="250" />
|
||||
<column name="isvalid" type="char" size="1" default="N" index="idx_is_valid" />
|
||||
<column name="cover_image" type="char" size="1" default="N" notnull="notnull" index="idx_list_order" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue