function drush_sql_create

8.0.x sql.drush.inc drush_sql_create()
6.x sql.drush.inc drush_sql_create()
7.x sql.drush.inc drush_sql_create()
5.x sql.drush.inc drush_sql_create()
master sql.drush.inc drush_sql_create()

Command callback. Create a database.

File

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

Code

function drush_sql_create() {
  $db_spec = _drush_sql_get_db_spec();

  // Prompt for confirmation.
  if (!drush_get_context('DRUSH_SIMULATE')) {
    $txt_destination = (isset($db_spec['remote-host']) ? $db_spec['remote-host'] . '/' : '') . $db_spec['database'];
    drush_print(dt("Creating database !target. Any possible existing database will be dropped!", array('!target' => $txt_destination)));

    if (!drush_confirm(dt('Do you really want to continue?'))) {
      return drush_user_abort();
    }
  }

  return _drush_sql_create($db_spec);
}