Declarative pure-SQL schema management for MySQL and MariaDB
Thank you to all code contributors and issue reporters!
An installation guide and full documentation are available on our website skeema.io.
SET_ANY_DEFINER
privilege is now properly handled by the strip-definer=auto Premium optionALTER TABLE ... ALGORITHM=COPY, LOCK=NONE
. As always, Skeema users can enforce a minimum algorithm/lock for generated ALTER TABLE statements by using Skeema's alter-algorithm and alter-lock options. However, users should be aware that the database server's built-in OSC can cause replication lag. Enabling MariaDB's binlog_alter_two_phase
server variable may help reduce or prevent this lag.skeema diff
and skeema push
: the verify option, which is enabled by default, now ignores cosmetic table discrepancies which are excluded from ALTER TABLE
generation anyway. This provides a major performance benefit in environments with many auto-increment tables or range-partitioned tables, among other situations. (bcd46d4)docker rm -v -f skeema-mysql-8.0
) if you wish for Skeema to recreate them with the new tuned settings.CREATE TABLE ... SELECT
statements in the filesystem previously caused their entire subdir to be skipped with a fatal errorCREATE TABLE ... WITH SYSTEM VERSIONING
(MariaDB-only database feature) statements in the filesystem previously would be erroneously removed by skeema pull
(#187, #206)See the Skeema v1.11 release announcement blog post for a summary of the most important changes in this release.
skeema push
needs to perform multiple trigger manipulations in the same schema, the corresponding parent tables are now briefly write-locked, to prevent data inconsistencies from writes which occur in the middle of the push operation.
CREATE OR REPLACE
syntax to atomically modify a trigger, this improvement now makes it safe to modify existing triggers, so allow-unsafe is no longer necessary in this situation.skeema
binary by 25-40%, and avoids spurious false-positive security warnings related to dependencies of the Docker client library. (#186, 2a2d8e3, 233c73e)skeema diff
and skeema push
. (#178, c6de431)skeema diff
and skeema push
. (76a7323)skeema diff
or skeema push
detects multiple unsafe changes, all such unsafe changes are now logged, instead of just the first one. Additionally, linting still occurs if unsafe changes are present, allowing the user to see all problematic unsafe statements and linter violations at the same time. (01a93d5)skeema diff
and skeema push
. (905ee14)
skeema diff
or skeema push
ALTER PROCEDURE
/ ALTER FUNCTION
, which is safe and atomic even in MySQL. (6fab6d8)skeema diff
and skeema push
, if the last statement for a schema required use of a nonstandard DELIMITER, the output will now also include a DELIMITER ;
line before moving on to the next schema. This is beneficial for users who pipe skeema diff
STDOUT to another program and then add additional SQL statements afterwards. (605b735)-EncodedCommand
option is now used in order to prevent problems with tricky nested escaping of quoted parameters.StrictHostKeyChecking=no
or StrictHostKeyChecking=ask
, Skeema could previously write the knownhosts entry incorrectly, in part due to an upstream Golang bug. Workarounds are now in place, thanks to community contributions to our open source knownhosts wrapper package. (https://github.com/skeema/knownhosts/pull/2, https://github.com/skeema/knownhosts/pull/4)Upgrade notice for users of Skeema's workspace=docker option:
docker
command-line client binary must be available in your $PATH to use workspace=docker. If you use this setting while also running skeema
inside of a container, you must ensure that skeema
's container has a working docker
binary prior to upgrading. See #186 for more information.skeema diff
and skeema push
can now generate supported ALTER TABLE
statements even for tables that already have unsupported features, as long as the new modification to the table does not affect those unsupported features. (#214, 7b5e86d)
ALTER TABLE
for such tables under any circumstances.)skeema init
and skeema pull
to always downcase the name of any newly-created .sql files. This has now been fixed, and the casing of the original table/object will be retained when naming the .sql file. (f0e52b7)
skeema init
or skeema pull
put them in.CREATE FUNCTION
or CREATE PROCEDURE
statement in the .sql file contained a DEFINER clause, workspace errors could result. This has now been fixed, and DEFINER clauses are now properly stripped from procs and funcs. (The bug did not affect views or triggers; those already worked properly and this remains the case.)skeema pull
needs to delete a .sql file because the corresponding table/object no longer exists in the database, file locking errors could sometimes occur on Skeema v1.10.0. This has now been fixed. (061f478)For a summary of the most important changes in this release, see the Skeema v1.10.0 release announcement blog post.
skeema push
handles INSERT statements found in your *.sql files. The default setting, inserts=seed, will execute INSERTs whenever the target table is empty.skeema pull
's new update-seed-inserts option provides a mechanism for selectively dumping row data from an environment using view logic, automatically creating or updating INSERT statements in your *.sql files.skeema diff --brief
now automatically disables linter checks and omits all INFO-level logging. These changes are designed to make the output more easily human-readable, while still surfacing any unusual errors or warnings. (310164a)skeema lint
, skeema diff
, and skeema push
now omits embedded newlines. Previously, each annotation message could span multiple lines, which made automated parsing and processing more difficult. Now, each individual annotation message will consist of a single line when STDERR isn't a terminal. (#211)skeema init
would hang for a long period if a large .sql file was present in the working directory, for example mysqldump
output from a large database. The contents of the working directory no longer affect skeema init
. (#190, 2481bed)Thank you to all code contributors and issue reporters!
For a summary of the most important changes in this release, see the Skeema v1.9.0 release announcement blog post.
inet4
column type. (53de093)skeema
from a parent directory), it is now possible to interactively prompt for different passwords for each host, by configuring the bare password option with no =value
in the same .skeema file as the host. (ab4a84c, 5e35143, b004616)
=value
was only supported in global option files. This still works, and still prompts for a single "global" password rather than host-specific ones.lock_wait_timeout
for its workspace=temp-schema
operations in MySQL 8 to limit any performance impact from such metadata locking conflicts. Note that only cross-schema FKs (and not same-schema FKs) are affected by the root issue, and only under MySQL 8 and workspace=temp-schema
. See commit message for more details. (762da89)TABLESPACE innodb_system
or TABLESPACE innodb_file_per_table
clauses are now supported for diff operations. These clauses permit overriding the server's innodb_file_per_table setting on an individual table basis. This syntax is only available in MySQL 5.7+, and is relatively rare. (9ed3f60)AUTO_INCREMENT
value in information_schema
vs SHOW CREATE TABLE
, even with information_schema_stats_expiry=0
which Skeema automatically uses for its sessions. When this occurred, tables were unsupported for diff operations. To solve this, Skeema now relies on the SHOW CREATE TABLE
value exclusively, and these tables are now properly supported for diffs. (677d8de)skeema pull
or skeema add-environment
needs to rewrite a .skeema file, some option values are now rewritten differently:
lint-pk=''
is now rewritten as skip-lint-pk
. These configurations have the exact same effect (and in this specific example both are equivalent to lint-pk=ignore
), but the empty-string value was less clear. (cf19abd)strip-definer
with no value (implying =true), previously these commands would incorrectly rewrite this as strip-definer=
(empty value implying false). Now fixed.skeema diff
and skeema push
. (894530f)For a summary of the most important changes in this release, see our blog post.
~/.ssh/config
, interacting with OpenSSH ssh-agent
via UNIX socket (Linux and MacOS) or named pipe (Windows), known_hosts
management, automatic keep-alives, multi-hop tunnels without need for agent forwarding, and more.DESC
index parts), as well as functions with IN / OUT / INOUT param qualifiers (1454f21)lower_case_table_names
setting
lower_case_table_names=1
(Windows default) or lower_case_table_names=2
(MacOS default) if any table, view, or database names used uppercase characters. These issues -- which related to the database's special handling of case-insensitive filesystems -- are now fixed, and Skeema's integration testing suite covers these situations. (#65, bdc279e)SHOW CREATE TABLE
and is now fixed by using a deeper structural comparison in the verify logic. Thank you to Etsy for the report! (#184, 8bde55a)skeema pull
now logs several problem conditions -- query failures, file I/O errors, etc -- as an error with exit code 2, instead of a warning with exit code 1. This is more consistent with how other commands handle these conditions. (2d3d7c4)lower_case_table_names=1
(e.g. server running on Windows, including Azure Database for MySQL) or lower_case_table_names=2
(server running on MacOS), and CREATE VIEW
statements in *.sql files had view names containing uppercase characters, nil pointer panics would occur in most Skeema commands due to case sensitivity mismatches. View name casing is now handled correctly even with lower_case_table_names=1 or 2.
SHOW CREATE VIEW
, unlike previous MySQL versions and all MariaDB versions. This view syntax (which is fairly uncommon) is now fully supported for all database versions.LIKE
, or check constraints using LIKE
, were inadvertently unsupported due to a logic error in Skeema’s previous prohibition of CREATE TABLE ... LIKE
statements. (#181, 6cbff9c)
CREATE TABLE ... LIKE
is now permitted for use in .sql files, and works properly in skeema diff
and skeema push
as long as the target table is a normal table in the same schema. The statement is evaluated dynamically, meaning any changes in the target table will be reflected properly in diffs for any tables that point to it.skeema pull
, skeema lint
, and skeema format
may overwrite CREATE TABLE ... LIKE
with a normal non-dynamic CREATE TABLE
. This functionality may be improved in a future release.An installation guide and full documentation are available on our website skeema.io.