Skip to content

Commit

Permalink
MDL-19695 dependencies - now every change_field_xxx() method looks fo…
Browse files Browse the repository at this point in the history
…r dependencies
  • Loading branch information
stronk7 committed Jul 30, 2009
1 parent da750a5 commit d274f20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ddl/database_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ public function change_field_type(xmldb_table $xmldb_table, xmldb_field $xmldb_f
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
Expand Down Expand Up @@ -696,6 +698,8 @@ public function change_field_default(xmldb_table $xmldb_table, xmldb_field $xmld
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
Expand Down

0 comments on commit d274f20

Please sign in to comment.