Skip to content
Snippets Groups Projects
Commit d4dcf002 authored by jurgenhaas's avatar jurgenhaas
Browse files

#12 Allow configuration of structure and skip tables for Drush sql operations

parent 2870b039
No related branches found
Tags v1.7.0
No related merge requests found
Pipeline #
......@@ -190,60 +190,68 @@ To overwrite the default settings for the Docker environment, add the relevant p
{
"extra": {
"docker4drupal": {
"projectname": "[NAME OF CURRENT DIRECTORY]",
"live": {
"root": "",
"uri": "",
"host": "",
"user": ""
},
"drupal": {
"version": 8
},
"php": {
"version": "7.0",
"xdebug": 1
},
"webserver": {
"type": "nginx",
"version": "1.13"
},
"varnish": {
"enable": 0
},
"redis": {
"version": "4.0"
},
"dbbrowser": {
"type": "pma"
},
"solr": {
"enable": 0,
"version": "6.6"
},
"node": {
"enable": 0,
"key": "",
"path": ""
},
"memcached": {
"enable": 0
},
"rsyslog": {
"enable": 0
},
"athenapdf": {
"enable": 0,
"key": ""
},
"blackfire": {
"enable": 0,
"id": "",
"token": ""
},
"webgrind": {
"enable": 0
"projectname": "[NAME OF CURRENT DIRECTORY]",
"live": {
"root": "",
"uri": "",
"host": "",
"user": ""
},
"drush": {
"sql": {
"tables": {
"structure": ["cache", "cache_*", "history", "search_*", "sessions", "watchdog"],
"skip": ["none"]
}
}
},
"drupal": {
"version": 8
},
"php": {
"version": "7.0",
"xdebug": 1
},
"webserver": {
"type": "nginx",
"version": "1.13"
},
"varnish": {
"enable": 0
},
"redis": {
"version": "4.0"
},
"dbbrowser": {
"type": "pma"
},
"solr": {
"enable": 0,
"version": "6.6"
},
"node": {
"enable": 0,
"key": "",
"path": ""
},
"memcached": {
"enable": 0
},
"rsyslog": {
"enable": 0
},
"athenapdf": {
"enable": 0,
"key": ""
},
"blackfire": {
"enable": 0,
"id": "",
"token": ""
},
"webgrind": {
"enable": 0
}
}
}
}
......
......@@ -222,6 +222,14 @@ class Handler {
'host' => '',
'user' => $env->receive('live_host_username', 'Remote username for host of the live site', getenv('USER')),
],
'drush' => [
'sql' => [
'tables' => [
'structure' => ['cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog',],
'skip' => ['none',],
],
],
],
'drupal' => [
'version' => '8',
],
......
<?php
$options['structure-tables']['common'] = array('cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog');
$options['structure-tables']['common'] = array('{{ drush.sql.tables.structure|join('\', \'')|raw }}');
$options['skip-tables']['common'] = array('{{ drush.sql.tables.skip|join('\', \'')|raw }}');
$options['shell-aliases']['pull-sql'] = '!drush -y --create-db --structure-tables-key=common sql-sync @live @dev && drush -y @dev {{ (drupal.version == 8) ? 'cr' : 'cc all' }} && drush -y @dev dev on';
$options['shell-aliases']['pull-sql'] = '!drush -y --create-db --structure-tables-key=common --skip-tables-list={{ drush.sql.tables.skip|join(',') }} sql-sync @live @dev && drush -y @dev {{ (drupal.version == 8) ? 'cr' : 'cc all' }} && drush -y @dev dev on';
$options['shell-aliases']['pull-files'] = '!drush -y rsync @live:%files @dev:%files --mode=rlDzq --chown=www-data:www-data --safe-links --max-size=20M && drush -y rsync @live:%private @dev:%private --mode=rlDzq --chown=www-data:www-data --safe-links --max-size=20M';
$options['shell-aliases']['pull-all'] = $options['shell-aliases']['pull-sql'] . ' && ' . $options['shell-aliases']['pull-files'];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment