function drush_sql_register_post_sync_op

8.0.x sql.drush.inc drush_sql_register_post_sync_op($id, $message, $query = NULL)
6.x sql.drush.inc drush_sql_register_post_sync_op($id, $message, $query = NULL)
7.x sql.drush.inc drush_sql_register_post_sync_op($id, $message, $query = NULL)
4.x sql.drush.inc drush_sql_register_post_sync_op($id, $message, $query = NULL)
5.x sql.drush.inc drush_sql_register_post_sync_op($id, $message, $query = NULL)
master sql.drush.inc drush_sql_register_post_sync_op($id, $message, $query = NULL)

Call from a pre-sql-sync hook to register an sql query to be executed in the post-sql-sync hook.

Parameters

$id: String containing an identifier representing this operation. This id is not actually used at the moment, it is just used to fufill the contract of drush contexts.

$message: String with the confirmation message that describes to the user what the post-sync operation is going to do. This confirmation message is printed out just before the user is asked whether or not the sql-sync operation should be continued.

$query: String containing the sql query to execute. If no query is provided, then the confirmation message will be displayed to the user, but no action will be taken in the post-sync hook. This is useful for drush modules that wish to provide their own post-sync hooks to fix up the target database in other ways (e.g. through Drupal APIs).

See also

drush_sql_pre_sql_sync() and @see drush_sql_post_sql_sync().

2 calls to drush_sql_register_post_sync_op()

File

commands/sql/sql.drush.inc, line 522
Drush sql commands

Code

function drush_sql_register_post_sync_op($id, $message, $query = NULL) {
  $options = drush_get_context('post-sync-ops');

  $options[$id] = array(
    'message' => $message,
    'query' => $query,
  );

  drush_set_context('post-sync-ops', $options);
}