]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19695 dependencies - now every change_field_xxx() method looks for dependencies
authorstronk7 <stronk7>
Thu, 30 Jul 2009 18:54:54 +0000 (18:54 +0000)
committerstronk7 <stronk7>
Thu, 30 Jul 2009 18:54:54 +0000 (18:54 +0000)
lib/ddl/database_manager.php

index d3e33a7c3d5184ad3021c31547efc8fb242131e9..fe9dd84fafd8d2b7cf0c7a27752a97135322ff37 100644 (file)
@@ -636,6 +636,8 @@ class database_manager {
         if (!$this->field_exists($xmldb_table, $xmldb_field)) {
             throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName());
         }
+    /// Check for dependencies in the DB before performing any action
+        $this->check_field_dependencies($xmldb_table, $xmldb_field);
 
         if (!$sqlarr = $this->generator->getAlterFieldSQL($xmldb_table, $xmldb_field)) {
             return; // probably nothing to do
@@ -696,6 +698,8 @@ class database_manager {
         if (!$this->field_exists($xmldb_table, $xmldb_field)) {
             throw new ddl_field_missing_exception($xmldb_field->getName(), $xmldb_table->getName());
         }
+    /// Check for dependencies in the DB before performing any action
+        $this->check_field_dependencies($xmldb_table, $xmldb_field);
 
         if (!$sqlarr = $this->generator->getModifyDefaultSQL($xmldb_table, $xmldb_field)) {
             return; //Empty array = nothing to do = no error