namespace db
The namespace db offers tasks to handle the database configuration, structure and content.
add_default_content
Add default content from config/preseed/default_content.sql.gz to database
Usage
Used for initial setup of the project. This requires an existing database configuration (see upload_settings).
add_default_structure
Add structure content from config/preseed/default_structure.sql.gz to database
Usage
Used for initial setup of the project. This requires an existing database configuration (see upload_settings).
Output
console
Run interactive MySQL console.
Usage
This function requires an existing configuration file on the target stage.
download
Dump complete database without cache table content to local temp folder. Triggers the task downloadstructure and download_content.
Usage
download_content
Dump complete database content without cache tables and structure to local temp folder
Usage
download_structure
Dumps complete database structure without content
Usage
download_tables
Download database tables.
Usage
This task offers three parameters :file_path
, :file_name
and :table_names
.
The variable file_path
defines the path where you want to download the database dump. Default value is temp.
The variable :file_name
defines the name of the file where the download is stored.
The tables to be dumped are set with :table_names
as a comma separated list of table names.
dump_table
Dump content of a database table to local folder
Usage
dump_tables
Dump content of a list of database tables to a local folder.
Usage
update
Upload, unzip and execute database script.
Configuration
This task requires the path to the database dump and the filename to be uploaded.
The file has to be compressed by gzip.
This task raises an error if the database dump could not be imported.
Usage
upload_settings
Upload database settings file. An existing configuration file will be deleted.
Usage
This task raises an error if the given credentials are not valid.
read_db_settings
Load the database configuration from the given stage.
Configuration
This tasks requires an existing database configuration file on the target stage.
The filename containing the configuration starts with db_settings., the name of the stage. The filename ends with .yaml
Example
There are no variables that need to be configured.
Usage
This task is used internally when
- Database content or structure is downloaded
- Doctrine migrations are executed
Output
There is no output on the screen. The Yaml file is available in the temp directory.
Example for a db_settings file:
upload_tables
This task update database tables. Additional a MD5 hash is generated and stored on the server. If this task is executed again with the same file the MD5 hash is used to check if an updated is required.