return array('Code to drop one default goes to getDropDefaultSQL()');
}
+ /**
+ * Given one XMLDBTable and one optional XMLDBField, return one array with all the check
+ * constrainst found for that table (or field). Must exist for each DB supported.
+ * (usually invoked from find_check_constraint_name)
+ */
+ function getCheckConstraintsFromDB($xmldb_table, $xmldb_field=null) {
+ return array('Code to fetch check constraints goes to getCheckConstraintsFromDB()');
+ }
+
/**
* Given one XMLDBTable and one XMLDBField, return the SQL statements needded to add its default
* (usually invoked from getModifyDefaultSQL()
}
/**
- * Given one XMLDBTable returns one array with all the check constrainsts
+ * Given one XMLDBTable returns one array with all the check constrainsts
* in the table (fetched from DB)
+ * Optionally the function allows one xmldb_field to be specified in
+ * order to return only the check constraints belonging to one field.
* Each element contains the name of the constraint and its description
* If no check constraints are found, returns an empty array
*/
- function getCheckConstraintsFromDB($xmldb_table) {
+ function getCheckConstraintsFromDB($xmldb_table, $xmldb_field = null) {
$results = array();
}
/**
- * Given one XMLDBTable returns one array with all the check constrainsts
+ * Given one XMLDBTable returns one array with all the check constrainsts
* in the table (fetched from DB)
+ * Optionally the function allows one xmldb_field to be specified in
+ * order to return only the check constraints belonging to one field.
* Each element contains the name of the constraint and its description
* If no check constraints are found, returns an empty array
* MySQL doesn't have check constraints in this implementation, but
* we return them based on the enum fields in the table
*/
- function getCheckConstraintsFromDB($xmldb_table) {
+ function getCheckConstraintsFromDB($xmldb_table, $xmldb_field = null) {
global $db;
}
/**
- * Given one XMLDBTable returns one array with all the check constrainsts
+ * Given one XMLDBTable returns one array with all the check constrainsts
* in the table (fetched from DB)
+ * Optionally the function allows one xmldb_field to be specified in
+ * order to return only the check constraints belonging to one field.
* Each element contains the name of the constraint and its description
* If no check constraints are found, returns an empty array
*/
- function getCheckConstraintsFromDB($xmldb_table) {
+ function getCheckConstraintsFromDB($xmldb_table, $xmldb_field = null) {
$results = array();
$notnullchanged = false;
}
+ /// TODO: Some combinations like
+ /// TODO: integer->integer
+ /// TODO: integer->text
+ /// TODO: number->text
+ /// TODO: text->text
+ /// TODO: do not require the use of temp columns, because PG 8.0 supports them automatically
+ /// TODO: with a simple "alter table zzz alter column yyy type new specs"
+ /// TODO: Must be implemented that way. Eloy 09/2007
+
/// If the type or the precision or the decimals have changed, then we need to:
/// - create one temp column with the new specs
/// - fill the new column with the values from the old one (casting if needed)
}
/**
- * Given one XMLDBTable returns one array with all the check constrainsts
+ * Given one XMLDBTable returns one array with all the check constrainsts
* in the table (fetched from DB)
+ * Optionally the function allows one xmldb_field to be specified in
+ * order to return only the check constraints belonging to one field.
* Each element contains the name of the constraint and its description
* If no check constraints are found, returns an empty array
*/
- function getCheckConstraintsFromDB($xmldb_table) {
+ function getCheckConstraintsFromDB($xmldb_table, $xmldb_field = null) {
$results = array();