Merge pull request #1266 from izuzero/develop.15

DB Column 생성 시 기본값으로 0을 지정할 수 없는 문제 해결
This commit is contained in:
bnu 2015-03-23 19:53:50 +09:00
commit 4443745bd7
3 changed files with 6 additions and 6 deletions

View file

@ -479,7 +479,7 @@ class DBCubrid extends DB
* @param boolean $notnull not null status, default value is false
* @return void
*/
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = '', $notnull = FALSE)
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = FALSE)
{
$type = strtoupper($this->column_type[$type]);
if($type == 'INTEGER')
@ -506,7 +506,7 @@ class DBCubrid extends DB
$query .= sprintf("%s ", $type);
}
if($default)
if(isset($default))
{
if($type == 'INTEGER' || $type == 'BIGINT' || $type == 'INT')
{

View file

@ -377,7 +377,7 @@ class DBMssql extends DB
* @param boolean $notnull not null status, default value is false
* @return void
*/
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = '', $notnull = false)
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false)
{
if($this->isColumnExists($table_name, $column_name))
{
@ -399,7 +399,7 @@ class DBMssql extends DB
$query .= sprintf(" %s ", $type);
}
if($default)
if(isset($default))
{
$query .= sprintf(" default '%s' ", $default);
}

View file

@ -299,7 +299,7 @@ class DBMysql extends DB
* @param boolean $notnull not null status, default value is false
* @return void
*/
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = '', $notnull = false)
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false)
{
$type = $this->column_type[$type];
if(strtoupper($type) == 'INTEGER')
@ -316,7 +316,7 @@ class DBMysql extends DB
{
$query .= sprintf(" %s ", $type);
}
if($default)
if(isset($default))
{
$query .= sprintf(" default '%s' ", $default);
}