diff --git a/modules/block/block.install b/modules/block/block.install index c45b076bf75f75407e8866c2ecd21975c0ca9941..b2ab477d90932ca2cf104bd09116102329858b13 100644 --- a/modules/block/block.install +++ b/modules/block/block.install @@ -190,16 +190,12 @@ function block_install() { * Implements hook_update_dependencies(). */ function block_update_dependencies() { - // Block update 7005 needs to query the list of existing text formats and - // therefore must run after filter_update_7000(). + // block_update_7005() needs to query the {filter_format} table to get a list + // of existing text formats, so it must run after filter_update_7000(), which + // creates that table. $dependencies['block'][7005] = array( 'filter' => 7000, ); - // Ensure that format columns are only changed after Filter module has changed - // the primary records. - $dependencies['block'][7007] = array( - 'filter' => 7010, - ); return $dependencies; } diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 120467fd0594d0d7e3e88e7658655dae6ef987f2..cda3c308d5f485f4225ae5db08c012bffe61eb40 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -83,14 +83,16 @@ function comment_modules_enabled($modules) { * Implements hook_update_dependencies(). */ function comment_update_dependencies() { - // Comment update 7005 creates the comment body field and therefore must run - // after text module has been enabled and entities have been updated. + // comment_update_7005() creates the comment body field and therefore must + // run after all Field modules have been enabled, which happens in + // system_update_7027(). $dependencies['comment'][7005] = array( - 'system' => 7021, + 'system' => 7027, ); - // Comment update 7006 needs to query the list of existing text formats and - // therefore must run after filter_update_7000(). + // comment_update_7006() needs to query the {filter_format} table to get a + // list of existing text formats, so it must run after filter_update_7000(), + // which creates that table. $dependencies['comment'][7006] = array( 'filter' => 7000, ); diff --git a/modules/field/modules/text/text.install b/modules/field/modules/text/text.install index b9bd25f19932640b6e9d6bb878af5c78b43fd208..61be748ac4055f30b7fff2aca8fb9ed70ab699a2 100644 --- a/modules/field/modules/text/text.install +++ b/modules/field/modules/text/text.install @@ -66,19 +66,6 @@ function text_field_schema($field) { ); } -/** - * Implements hook_update_dependencies(). - */ -function text_update_dependencies() { - // Ensure that format columns are only changed after Filter module has changed - // the primary records. - $dependencies['text'][7000] = array( - 'filter' => 7010, - ); - - return $dependencies; -} - /** * Change text field 'format' columns into varchar. */ diff --git a/modules/filter/filter.install b/modules/filter/filter.install index 84512cd589f404b61d4903e7dc4af8d7e13fd188..19fd8aa18297a18294e2294fae3b139607d07814 100644 --- a/modules/filter/filter.install +++ b/modules/filter/filter.install @@ -152,8 +152,9 @@ function filter_install() { * Implements hook_update_dependencies(). */ function filter_update_dependencies() { - // Filter update 7007 migrates permissions and therefore needs to run after - // the {role} table is properly set up. + // filter_update_7005() migrates role permissions and therefore must run + // after the {role} and {role_permission} tables are properly set up, which + // happens in user_update_7007(). $dependencies['filter'][7005] = array( 'user' => 7007, ); diff --git a/modules/node/node.install b/modules/node/node.install index 2498091fc533896ac2e885235a5d50e6ffc41d8c..d33f095f07cf493cf199d3f1742f8278d3c9f330 100644 --- a/modules/node/node.install +++ b/modules/node/node.install @@ -447,17 +447,23 @@ function node_install() { * Implements hook_update_dependencies(). */ function node_update_dependencies() { - // Node update 7006 migrates node data to fields and therefore must run after - // the Field module has been enabled, but before upgrading field data. + // node_update_7006() migrates node data to fields and therefore must run + // after all Field modules have been enabled, which happens in + // system_update_7027(). It also needs to query the {filter_format} table to + // get a list of existing text formats, so it must run after + // filter_update_7000(), which creates that table. $dependencies['node'][7006] = array( - 'system' => 7049, - // It must also run after filter_update_7000() because it needs to query - // the list of existing text formats. + 'system' => 7027, 'filter' => 7000, ); - $dependencies['system'][7050] = array( - 'node' => 7006, + + // node_update_7008() migrates role permissions and therefore must run after + // the {role} and {role_permission} tables are properly set up, which happens + // in user_update_7007(). + $dependencies['node'][7008] = array( + 'user' => 7007, ); + return $dependencies; } diff --git a/modules/system/system.install b/modules/system/system.install index e55c7cf3aa7e6d7f8c6fe2e8c0c31dca293a6e46..6cbbb9ed018c543237c6985b94eec687fe902b0d 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1681,11 +1681,19 @@ function system_update_last_removed() { * Implements hook_update_dependencies(). */ function system_update_dependencies() { - // Update 7053 adds new blocks, so make sure the block tables are updated. + // system_update_7053() queries the {block} table, so it must run after + // block_update_7002(), which creates that table. $dependencies['system'][7053] = array( 'block' => 7002, ); + // system_update_7067() migrates role permissions and therefore must run + // after the {role} and {role_permission} tables are properly set up, which + // happens in user_update_7007(). + $dependencies['system'][7067] = array( + 'user' => 7007, + ); + return $dependencies; } @@ -1866,9 +1874,6 @@ function system_update_7005() { /** * Convert to new method of storing permissions. - * - * This update is in system.install rather than user.install so that - * all modules can use the updated permission scheme during their updates. */ function system_update_7007() { // Copy the permissions from the old {permission} table to the new {role_permission} table. diff --git a/modules/taxonomy/taxonomy.install b/modules/taxonomy/taxonomy.install index 68fbc7804a99922d6b00b432c6c9b7c5b3c48686..f442c95ef175347987efa73bc80e7939b4b35c9d 100644 --- a/modules/taxonomy/taxonomy.install +++ b/modules/taxonomy/taxonomy.install @@ -251,26 +251,11 @@ function taxonomy_field_schema($field) { * Implements hook_update_dependencies(). */ function taxonomy_update_dependencies() { - // Taxonomy update 7002 creates comment Field API bundles and therefore must - // run after the Field module has been enabled, but before upgrading field - // data. - $dependencies['taxonomy'][7002] = array( - 'system' => 7049, - ); - $dependencies['user'][7006] = array( - 'taxonomy' => 7002, - ); - $dependencies['system'][7050] = array( - 'taxonomy' => 7002, - ); - // It also must run before nodes are upgraded to use the Field API. - $dependencies['node'][7006] = array( - 'taxonomy' => 7002, - ); - // Ensure that format columns are only changed after Filter module has changed - // the primary records. - $dependencies['taxonomy'][7009] = array( - 'filter' => 7010, + // taxonomy_update_7004() migrates taxonomy term data to fields and therefore + // must run after all Field modules have been enabled, which happens in + // system_update_7027(). + $dependencies['taxonomy'][7004] = array( + 'system' => 7027, ); return $dependencies; diff --git a/modules/user/user.install b/modules/user/user.install index 75fca659014f2d494ce51e9a6962b2e56fe05a01..2867b97ed2c0e772a0b4a303b47f760a1fc96400 100644 --- a/modules/user/user.install +++ b/modules/user/user.install @@ -340,25 +340,32 @@ function user_install() { * Implements hook_update_dependencies(). */ function user_update_dependencies() { - // Run all the critical user upgrades before everything. - $dependencies['system'][7000] = array( - 'user' => 7008, - ); - // Both user_update_7006() and user_update_7010() need to query the list of - // existing text formats and therefore must run after filter_update_7003(). - // @todo: move user_update_7006 down below in the upgrade process. + // user_update_7006() updates data in the {role_permission} table, so it must + // run after system_update_7007(), which populates that table. $dependencies['user'][7006] = array( - 'filter' => 7003, + 'system' => 7007, + ); + + // user_update_7010() needs to query the {filter_format} table to get a list + // of existing text formats, so it must run after filter_update_7000(), which + // creates that table. + $dependencies['user'][7010] = array( + 'filter' => 7000, ); - // user_update_7013 relies on system_update_7060. + + // user_update_7012() uses the file API, which relies on the {file_managed} + // table, so it must run after system_update_7034(), which creates that + // table. + $dependencies['user'][7012] = array( + 'system' => 7034, + ); + + // user_update_7013() uses the file usage API, which relies on the + // {file_usage} table, so it must run after system_update_7059(), which + // creates that table. $dependencies['user'][7013] = array( 'system' => 7059, ); - // Ensure that format columns are only changed after Filter module has changed - // the primary records. - $dependencies['user'][7015] = array( - 'filter' => 7010, - ); return $dependencies; }