mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 20:29:57 +09:00
Module의 업데이트 필요 현황을 파악하고 업데이트를 할 수 있는 코드 추가. db의 column exists정보와 add column 기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1974 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cb2254ef96
commit
a2eb5d62bf
38 changed files with 299 additions and 64 deletions
|
|
@ -203,6 +203,36 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 테이블에 특정 column 추가
|
||||
**/
|
||||
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
|
||||
$type = $this->column_type[$type];
|
||||
if(strtoupper($type)=='INTEGER') $size = '';
|
||||
|
||||
$query = sprintf("alter class %s%s add %s ", $this->prefix, $table_name, $column_name);
|
||||
if($size) $query .= sprintf(" %s(%s) ", $type, $size);
|
||||
else $query .= sprintf(" %s ", $type);
|
||||
if($default) $query .= sprintf(" default '%s' ", $default);
|
||||
if($notnull) $query .= " not null ";
|
||||
|
||||
$this->_query($query);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 테이블의 column의 정보를 return
|
||||
**/
|
||||
function isColumnExists($table_name, $column_name) {
|
||||
$query = sprintf("select %s from db_attribute where class_name = '%s%s'", $column_name, $this->prefix, $table_name);
|
||||
$result = $this->_query($query);
|
||||
if(cubrid_num_rows($result)>0) $output = true;
|
||||
else $output = false;
|
||||
|
||||
if($result) cubrid_close_request($result);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief xml 을 받아서 테이블을 생성
|
||||
**/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue