sy / flyway
Utility PHP script for running Flyway on a sy/project
Requires
None
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Flyway utility script used on sy/project.
Installation
composer require sy/flyway
Usage
protected/vendor/bin/flyway --conf protected/conf/database.ini --sql protected/sql [options] [task]
| Option | Long | Default | Effect |
|---|---|---|---|
-c |
--conf |
— | INI file with host, port, dbname, username, password (required) |
-s |
--sql |
— | migrations directory, mounted at /sql-migrations (required) |
-t |
--task |
migrate |
Flyway command: migrate, info, repair, clean, validate, baseline |
-a |
--args |
— | extra arguments forwarded to Flyway (-baselineOnMigrate=true …) |
--image |
— | full image reference, for example flyway/flyway:13.13.0 |
|
--version |
— | Flyway tag, shorthand for flyway/flyway:<tag> |
|
--pull |
always for :latest, missing for a tag |
always, missing or never |
The image is resolved from --image, then --version, then $SY_FLYWAY_IMAGE, then
flyway/flyway:latest. Latest is the default on purpose: a managed database newer than
the Flyway release needs the fixes shipped in the next one. Pin a tag where a migration
has to be reproducible — --version=13.13.0, or SY_FLYWAY_IMAGE in the environment of
the deploy.
The exit code of the container becomes the exit code of the script, so a failing migration
stops the caller — bin/sy treats it as a failed step and the deploy does not publish.
Docker access: the current user must be root or belong to the docker group. The script
does not call sudo, which would reset the caller's PATH.
When host is a container name, Flyway runs in that container's network namespace
(--network container:<host>); an IP address or a DNS name is reached from the default
bridge.