Databases
If a project uses at least one database, it must be defined in configuration. You must give it an ID. Using that ID, it can be referenced in other parts of the configuration. You may define multiple databases if that applies to your situation.
You must also define which plugin is used to access your database, along with the plugin-specifiy configuation. Example plugins are: mysql, env, lando, _landogit.
If you have more than one database defined, the first listed in the configuration will be assumed unless you specify otherwise with --database=ID. In the following configuration example, primary will be assumed the default database.
environments:
-
id: local
databases:
primary:
plugin: lando
service: database
secondary:
plugin: lando
service: alt_database
Excluding Tables or Data for Different Commands
You can omit entire tables using exclude_tables.
You may want to omit data from certain tables, such as in the case of cache tables. This is the reason for exclude_table_data. List one or more tables (astrix globbing allowed), whose structure only should be copied.
Create one or more workflows with your table/data exclusion rules. Then use those workflows as command arguments.
workflows:
development:
-
database: drupal
exclude_table_data:
- cache*
- batch
To export only table structure and no data from any table, do like this:
workflows:
development:
-
database: drupal
exclude_table_data:
- "*"
If you wish to omit entire tables--data AND structure--you will list those tables in exclude_tables.
workflows:
development:
-
database: drupal
exclude_tables:
- foo
- bar
Explicitly Including Tables
The counterpoint keys are also available: include_table_structure, and include_tables_and_data. They cannot, however be used at the same time as their exclude_ counterparts.
To cherry pick only tables and data use include_tables_and_data.
To cherry pick table structure only use include_table_structure.