skeema diff [<options>] [<environment>]
Compares the schemas on database instance(s) to the corresponding filesystem representation of them. The output is a series of DDL commands that, if run on the instance, would cause the instances' schemas to now match the definitions from the filesystem.
You may optionally pass an environment name as a CLI arg. This will affect which section of .skeema config files is used for processing. For example, running
skeema diff 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”.
skeema diff command is equivalent to running
skeema push with its dry-run option enabled.
An exit code of 0 will be returned if no differences were found; 1 if some differences were found; or 2+ if an error occurred.
DDL Generation Options
|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|
|partitioning||Specify handling of partitioning status on the database side|
Linter Rule Options
|allow-unsafe||Permit generating ALTER or DROP operations that are potentially destructive|
|safe-below-size||Always permit generating 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)|
|brief||Don’t output DDL to STDOUT; instead output list of instances with at least one difference|
|concurrent-instances||Perform operations on this number of instances concurrently|
|first-only||For dirs mapping to multiple instances or schemas, just run against the first per dir|
|connect-options||Comma-separated session options to set upon connecting to each database instance|
|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-schema||Ignore schemas that match regex|
|ignore-table||Ignore tables that match regex|
|ignore-trigger||Ignore triggers 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 (default no password)|
|user||Username to connect to database host|
|version||Display program version|