Skip to content

Commit

Permalink
rename_field() under oracle completed
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 2, 2006
1 parent ec6adca commit c562997
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/xmldb/classes/generators/oci8po/oci8po.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ class XMLDBoci8po extends XMLDBgenerator {

var $rename_table_extra_code = true; //Does the generator need to add code after table rename

var $rename_column_extra_code = true; //Does the generator need to add code after field rename

var $enum_inline_code = false; //Does the generator need to add inline code in the column definition

var $alter_column_sql = 'ALTER TABLE TABLENAME MODIFY (COLUMNSPECS)'; //The SQL template to alter columns
Expand Down Expand Up @@ -201,6 +203,26 @@ function getCommentSQL ($xmldb_table) {
return array($comment);
}

/**
* Returns the code (array of statements) needed to execute extra statements on field rename
*/
function getRenameFieldExtraSQL ($xmldb_table, $xmldb_field, $newname) {

$results = array();

/// If the field is enum, drop and re-create the check constraint
if ($xmldb_field->getEnum()) {
/// Drop the current enum
$results = array_merge($results, $this->getDropEnumSQL($xmldb_table, $xmldb_field));
/// Change field name
$xmldb_field->setName($newname);
/// Recreate the enum
$results = array_merge($results, $this->getCreateEnumSQL($xmldb_table, $xmldb_field));
}

return $results;
}

/**
* Returns the code (array of statements) needed to execute extra statements on table drop
*/
Expand Down

0 comments on commit c562997

Please sign in to comment.