Redgate Flyway

Deploy

Deploy

The deploy command executes a deployment script against a target database. Can be used in conjunction with scripts generated by flyway prepare.

Usage examples

Deploying an arbitrary SQL script

flyway deploy -scriptFilename="D__deployment.sql" -environment=production

Deploying a deployment script generated by prepare

flyway prepare -source=schemaModel -target=production -scriptFilename=D__deployment.sql
flyway deploy -scriptFilename="D__deployment.sql" -environment=production

Note that it is also possible to chain these commands:

flyway prepare deploy -source=schemaModel -target=production -environment=production

Complete list of parameters

Optional

Parameter Namespace Description
scriptFilename deploy The path to the script that will be deployed. Defaults to deployments/D__deployment.sql.
batch (root) Whether to batch SQL statements when executing them.
configFiles (root) The location of the flyway configuration files.
encoding (root) The encoding of the script to be deployed.
environment (root) The name of the environment to deploy to.
{environment parameters} (root) Environment configuration for the target environment.
executeInTransaction (root) Whether to run the script within a transaction.
workingDirectory (root) The directory to consider the current working directory. All relative paths will be considered relative to this.

JSON output format

{
  "scriptExecuted": "C:\\workingDirectory\\D__deployment.sql",
  "deploymentResults": [],
  "database": "production"
}

Didn't find what you were looking for?