Usage: skeema push [<options>] [<environment>]
Modifies the schemas on database server(s) to match the corresponding filesystem representation of them. This essentially performs the same diff logic as skeema diff
, but then actually runs the generated DDL. You should generally run skeema diff
first to see what changes will be applied.
You may optionally pass an environment name as a command-line arg. This will affect which section of .skeema config files is used for processing. For example, running skeema push staging
will apply config directives from the [staging] section of config files, as well as any sectionless directives at the top of the file. If no environment name is supplied, the default is “production”.
An exit code of 0 will be returned if the operation was fully successful; 1 if at least one table could not be updated due to use of unsupported features, or if the dry-run option was used and differences were found; or 2+ if a fatal error occurred.
SQL Generation Options
Option | Description |
---|
alter-algorithm | Apply an ALGORITHM clause to all ALTER TABLEs |
alter-lock | Apply a LOCK clause to all ALTER TABLEs |
alter-validate-virtual | Apply a WITH VALIDATION clause to ALTER TABLEs affecting virtual columns |
compare-metadata | For stored programs, detect changes to creation-time sql_mode or DB collation |
exact-match | Follow *.sql table definitions exactly, even for differences with no functional impact |
inserts | Determine whether to process INSERT statements found in the *.sql files |
lax-column-order | When comparing tables, don’t re-order columns if they only differ by position |
lax-comments | When comparing tables, routines, or events, don’t modify them if they only differ by COMMENT clauses |
partitioning | Specify handling of partitioning status on the database side |
strip-definer | Ignore DEFINER clauses when comparing stored objects |
Linter Rule Options
Safety Options
Option | Description |
---|
allow-unsafe | Permit running ALTER or DROP operations that are potentially destructive |
dry-run | Output DDL but don’t run it; equivalent to skeema diff |
foreign-key-checks | Force the server to check referential integrity of any new foreign key |
safe-below-size | Always permit destructive operations for tables below this size in bytes |
verify | Test all generated ALTER statements on temp schema to verify correctness (enabled by default; disable with skip-verify) |
Sharding Options
Option | Description |
---|
concurrent-instances | Perform operations on this number of database servers concurrently |
first-only | For dirs mapping to multiple hosts or schemas, only run against the first target per dir |
Workspace Options
Global Options
Option | Description |
---|
connect-options | Comma-separated session options to set upon connecting to each database server |
debug | Enable debug logging |
help | Display usage information for the specified command |
host-wrapper | External bin to shell out to for host lookup; see manual for template vars |
ignore-event | Ignore events that match regex |
ignore-func | Ignore functions that match regex |
ignore-proc | Ignore stored procedures that match regex |
ignore-schema | Ignore schemas that match regex |
ignore-table | Ignore tables or views that match regex |
ignore-trigger | Ignore triggers that match regex |
ignore-view | Ignore views that match regex |
my-cnf | Parse ~/.my.cnf for configuration (enabled by default; disable with skip-my-cnf) |
password | Password for database user; omit value to prompt from TTY |
server-public-key-path | File path to server public key in PEM format; omit to obtain from server |
ssh | Tunnel MySQL connections thru SSH to this hostname or user@hostname:port |
ssh-to-db | SSH to database host in order to establish database connections locally |
ssl-ca | File path to certificate authority in PEM format |
ssl-cert | File path to client-side public key in PEM format |
ssl-key | File path to client-side private key in PEM format |
ssl-mode | Specify desired connection security SSL/TLS usage |
ssl-verify-server-cert | Verify server-side cert matches server hostname |
user | Username to connect to database host |
version | Display program version |