From f020b357052481493cb94ac3a0ff30e5e3d853a9 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 28 Sep 2006 23:14:52 +0000 Subject: [PATCH] Moving some change_field_XXX() functions and introducing change_field_type(). Seems to work everywere but under mssql (due to some problems with default constraints). Will see it tomorrow. --- lib/ddllib.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/ddllib.php b/lib/ddllib.php index 4922864417..844c8ad9d8 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -489,7 +489,7 @@ function drop_field($table, $field, $continue=true, $feedback=true) { } /** - * This function will change the precision of the field in the table passed as arguments + * This function will change the type of the field in the table passed as arguments * * @uses $CFG, $db * @param XMLDBTable table object (just the name is mandatory) @@ -498,7 +498,7 @@ function drop_field($table, $field, $continue=true, $feedback=true) { * @param boolean feedback to specify to show status info (true) or not (false) * @return boolean true on success, false on error */ -function change_field_precision($table, $field, $continue=true, $feedback=true) { +function change_field_type($table, $field, $continue=true, $feedback=true) { global $CFG, $db; @@ -518,6 +518,22 @@ function change_field_precision($table, $field, $continue=true, $feedback=true) return execute_sql_arr($sqlarr, $continue, $feedback); } +/** + * This function will change the precision of the field in the table passed as arguments + * + * @uses $CFG, $db + * @param XMLDBTable table object (just the name is mandatory) + * @param XMLDBField field object (full specs are required) + * @param boolean continue to specify if must continue on error (true) or stop (false) + * @param boolean feedback to specify to show status info (true) or not (false) + * @return boolean true on success, false on error + */ +function change_field_precision($table, $field, $continue=true, $feedback=true) { + +/// Just a wrapper over change_field_type. Does exactly the same processing + return change_field_type($table, $field, $continue, $feedback); +} + /** * This function will change the unsigned/signed of the field in the table passed as arguments * @@ -530,8 +546,8 @@ function change_field_precision($table, $field, $continue=true, $feedback=true) */ function change_field_unsigned($table, $field, $continue=true, $feedback=true) { -/// Just a wrapper over change_field_precision. Does exactly the same processing - return change_field_precision($table, $field, $continue, $feedback); +/// Just a wrapper over change_field_type. Does exactly the same processing + return change_field_type($table, $field, $continue, $feedback); } /** @@ -546,8 +562,8 @@ function change_field_unsigned($table, $field, $continue=true, $feedback=true) { */ function change_field_notnull($table, $field, $continue=true, $feedback=true) { -/// Just a wrapper over change_field_precision. Does exactly the same processing - return change_field_precision($table, $field, $continue, $feedback); +/// Just a wrapper over change_field_type. Does exactly the same processing + return change_field_type($table, $field, $continue, $feedback); } /** -- 2.39.5