mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Allow a new column to be added at a specific position
This commit is contained in:
parent
e22551b224
commit
91550131ac
2 changed files with 12 additions and 2 deletions
|
|
@ -468,9 +468,10 @@ class DBCubrid extends DB
|
|||
* @param int $size column size
|
||||
* @param string|int $default default value
|
||||
* @param boolean $notnull not null status, default value is false
|
||||
* @param string $after_column
|
||||
* @return void
|
||||
*/
|
||||
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = FALSE)
|
||||
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false, $after_column = false)
|
||||
{
|
||||
$type = strtoupper($this->column_type[$type]);
|
||||
if($type == 'INTEGER')
|
||||
|
|
@ -513,6 +514,10 @@ class DBCubrid extends DB
|
|||
{
|
||||
$query .= "not null ";
|
||||
}
|
||||
if($after_column)
|
||||
{
|
||||
$query .= sprintf(" after `%s` ", $after_column);
|
||||
}
|
||||
|
||||
return $this->_query($query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,9 +281,10 @@ class DBMysql extends DB
|
|||
* @param int $size column size
|
||||
* @param string|int $default default value
|
||||
* @param boolean $notnull not null status, default value is false
|
||||
* @param string $after_column
|
||||
* @return void
|
||||
*/
|
||||
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false)
|
||||
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = null, $notnull = false, $after_column = false)
|
||||
{
|
||||
$type = $this->column_type[$type];
|
||||
if(strtoupper($type) == 'INTEGER')
|
||||
|
|
@ -308,6 +309,10 @@ class DBMysql extends DB
|
|||
{
|
||||
$query .= " not null ";
|
||||
}
|
||||
if($after_column)
|
||||
{
|
||||
$query .= sprintf(" after `%s` ", $after_column);
|
||||
}
|
||||
|
||||
return $this->_query($query);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue