mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
DB Column 생성 시 기본값으로 0을 지정할 수 없는 문제 해결
This commit is contained in:
parent
9f618fc331
commit
b21d6534f1
3 changed files with 6 additions and 6 deletions
|
|
@ -479,7 +479,7 @@ class DBCubrid extends DB
|
||||||
* @param boolean $notnull not null status, default value is false
|
* @param boolean $notnull not null status, default value is false
|
||||||
* @return void
|
* @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]);
|
$type = strtoupper($this->column_type[$type]);
|
||||||
if($type == 'INTEGER')
|
if($type == 'INTEGER')
|
||||||
|
|
@ -506,7 +506,7 @@ class DBCubrid extends DB
|
||||||
$query .= sprintf("%s ", $type);
|
$query .= sprintf("%s ", $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($default)
|
if(isset($default))
|
||||||
{
|
{
|
||||||
if($type == 'INTEGER' || $type == 'BIGINT' || $type == 'INT')
|
if($type == 'INTEGER' || $type == 'BIGINT' || $type == 'INT')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -377,7 +377,7 @@ class DBMssql extends DB
|
||||||
* @param boolean $notnull not null status, default value is false
|
* @param boolean $notnull not null status, default value is false
|
||||||
* @return void
|
* @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))
|
if($this->isColumnExists($table_name, $column_name))
|
||||||
{
|
{
|
||||||
|
|
@ -399,7 +399,7 @@ class DBMssql extends DB
|
||||||
$query .= sprintf(" %s ", $type);
|
$query .= sprintf(" %s ", $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($default)
|
if(isset($default))
|
||||||
{
|
{
|
||||||
$query .= sprintf(" default '%s' ", $default);
|
$query .= sprintf(" default '%s' ", $default);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ class DBMysql extends DB
|
||||||
* @param boolean $notnull not null status, default value is false
|
* @param boolean $notnull not null status, default value is false
|
||||||
* @return void
|
* @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];
|
$type = $this->column_type[$type];
|
||||||
if(strtoupper($type) == 'INTEGER')
|
if(strtoupper($type) == 'INTEGER')
|
||||||
|
|
@ -316,7 +316,7 @@ class DBMysql extends DB
|
||||||
{
|
{
|
||||||
$query .= sprintf(" %s ", $type);
|
$query .= sprintf(" %s ", $type);
|
||||||
}
|
}
|
||||||
if($default)
|
if(isset($default))
|
||||||
{
|
{
|
||||||
$query .= sprintf(" default '%s' ", $default);
|
$query .= sprintf(" default '%s' ", $default);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue