deploy.provision.inc 762 Bytes
Newer Older
1 2 3
<?php

function drush_db_provision_deploy_validate() {
4
  d()->service('db')->connect();
5 6
}

7
function drush_db_pre_provision_deploy() {
8
  d()->service('db')->create_site_database();
9 10
}

11
function drush_db_pre_provision_deploy_rollback() {
12
  d()->service('db')->destroy_site_database();
13 14
}

15 16 17 18 19
function drush_db_provision_deploy() {
  d()->service('db')->import_site_database();
}


20 21
// Rollback doesn't apply here yet. Unless we trigger a deploy of the first dump
// made. Which could go on infinitely if something is really long.
22
function drush_db_post_provision_deploy() {
23
  provision_file()->unlink(d()->site_path . '/database.sql')
24 25
    ->succeed('Removed dump file @path after restoring from it')
    ->fail('Could not remove dump file @path', 'DRUSH_PERM_ERROR');
26
}