Added support to change_field_enum() across all RDBMS

This commit is contained in:
stronk7
2006-09-30 17:03:17 +00:00
parent 9337f3e48d
commit b899d9bf1d
6 changed files with 135 additions and 2 deletions
@@ -259,6 +259,26 @@ class XMLDBpostgres7 extends XMLDBgenerator {
return $results;
}
/**
* Given one XMLDBTable and one XMLDBField, return the SQL statements needded to create its enum
* (usually invoked from getModifyEnumSQL()
*/
function getCreateEnumSQL($xmldb_table, $xmldb_field) {
/// All we have to do is to create the check constraint
return array('ALTER TABLE ' . $this->getTableName($xmldb_table) .
' ADD ' . $this->getEnumExtraSQL($xmldb_table, $xmldb_field));
}
/**
* Given one XMLDBTable and one XMLDBField, return the SQL statements needded to drop its enum
* (usually invoked from getModifyEnumSQL()
*/
function getDropEnumSQL($xmldb_table, $xmldb_field) {
/// All we have to do is to drop the check constraint
return array('ALTER TABLE ' . $this->getTableName($xmldb_table) .
' DROP CONSTRAINT ' . $this->getNameForObject($xmldb_table->getName(), $xmldb_field->getName(), 'ck'));
}
/**
* Given one XMLDBTable and one XMLDBField, return the SQL statements needded to create its default
* (usually invoked from getModifyDefaultSQL()