v0.5.0
v0.5.0 is a minor release that introduces Multi-file Schemas, Migration Linting as well as many small fixes and improvements.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.5.0
chmod +x ./atlas-darwin-amd64-v0.5.0
sudo mv ./atlas-darwin-amd64-v0.5.0 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.5.0
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.5.0 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.4.2
docker run --rm -p 5800:5800 arigaio/atlas:0.4.2
New Features
Migration Directory Linting
As most outages happen directly as a result of a change to a system, Atlas provides users with means to verify the safety of planned changes before they are applied. The sqlcheck package provides interfaces for analyzing the contents of SQL files to generate insights on the safety of many kinds of changes to database schemas.
This functionality is exposed to Atlas CLI users via the atlas migrate lint
command (docs). With migration directory linting, Atlas users can analyze the migration directory to automatically detect:
- Destructive changes
- Data-dependent changes
- Migration Directory integrity
- Backward-incompatible changes (coming soon)
- Drift between the desired and the migration directory (coming soon)
- .. and more
Multi-file schemas
Users can now define an Atlas schema across multiple HCL files. In addition, users may supply a directory name which contains schema files, from which Atlas will parse all HCL files for the various commands.
To supply multiple files as input via the command line, simply repeat the -f
flag in the schema apply
command, e.g:
atlas schema apply -f file.hcl -f another.hcl -u <URL of database>
Suppose your schema files reside in a directory named schema/
, you may now refer to it as well:
atlas schema apply -f schema/ -u <URL of database>
In addition, as of v0.5.0, users may supply a directory instead of a file name when specifying the location of the schema in an Atlas project file:
// Define an environment named "local"
env "local" {
// Declare where the schema definition resides.
// Also supported: src = ["file.hcl", "another.hcl"]
src = "schema"
}
Legal
The binaries distributed in this release are released under the Ariga End User License.
If you would like to build Atlas from source follow the instructions here.
What's Changed
- doc/blog: announce crdb by @hedwigz in #840
- doc/website/blog: minor fixes to post by @rotemtam in #852
- sql/sqlite: fix sequence primary key bug by @masseelch in #854
- sql/sqlcheck: add first basic analyzer by @a8m in #853
- doc/md: terraform with an existing database by @rotemtam in #855
- cmd/atlasci/internal: add basic reporting using templates by @a8m in #856
- cmd/atlasci/internal: add changedetetor for N latest changes by @a8m in #857
- cmd/atlasci: basic binary by @a8m in #860
- all: paritally update deps by @zeevmoney in #861
- atlasci/internal/ci: migration analyzer by @omarhachach in #859
- sql/migrate: basic stmt scanning by @a8m in #862
- cmd/atlasci: fix typo by @zeevmoney in #864
- sql/migrate: files containing
atlas:sum none
in their first line wi… by @masseelch in #866 - sql/mysql: support column-level charset and collate diffing by @a8m in #865
- sql/postgres: ensure identity column updates are not harmful by @a8m in #867
- Revert "sql/postgres: ensure identity column updates are not harmful" by @a8m in #871
- Revert of #871 by @a8m in #872
- sql/postgres: support dropping unique constraints by @a8m in #874
- cmd/atlasci: adding license subcommand by @rotemtam in #876
- sql/migrate: change Read to Bytes in File interface. by @a8m in #875
- cmd/atlasci: fix help message by @zeevmoney in #878
- cmd/atlasci: rm uneeded flag by @rotemtam in #877
- cmd/atlasci: fix error msg by @zeevmoney in #879
- sql/migrate: check revision state when attempting to compute pending … by @masseelch in #880
- sql/postgres: query pg_sequences only for identity columns by @a8m in #881
- sql/postgres: support inspecting interval types by @a8m in #882
- sql/postgres: support scanning and printing interval types by @a8m in #883
- sql/sqlclient: allow changing to no schema by @masseelch in #884
- internal/integration: add testscript for interval columns by @a8m in #885
- sql/sqlcheck: add summary changes for check files by @a8m in #887
- cmd/atlasci: fix default template by @zeevmoney in #888
- sql/sqlcheck: skip temporary resources in destructive analyzer by @a8m in #889
- sql/postgres: support precision and scale for numeric types in sqlspec by @a8m in #890
- sql/sqlcheck: remove analyzers to packages and expose control options by @a8m in #891
- cmd/atlasci: add integrity checks to summary report by @a8m in #892
- cmd/atlasci/internal: simplify git usage by using git cmd by @a8m in #893
- sqlcheck/datadepend: fix typo by @rotemtam in #896
- Fix typo in README.md by @ndrpnt in #895
- sql/mysql: can inspect indexes which are not support comment by @HatsuneMiku3939 in #863
- sql/migrate: StateReader if Dir has precedence by @masseelch in #900
- doc/md: documenting sqlcheck analyzers by @rotemtam in #897
- sql/mysql: unescape mysql expression strings by @a8m in #903
- sql/mysql/mysqlcheck: extend data-depend analysis by @a8m in #908
- schema/schemaspec/schemahcl: support evaluating multiple files by @rotemtam in #907
- cmd/atlas: move cmd/atlas to its own module by @a8m in #909
- cmd/atlas: merge atlasci with atlas migrate by @a8m in #910
- doc: inspection per driver by @a8m in #912
- doc: applying per driver by @a8m in #913
- all: miscellaneous changes while running manual testing by @a8m in #914
- all: remove the schemaspec package by @rotemtam in #911
- cmd/atlas: do not error on empty migration plan by @a8m in #915
- cmd/atlas/internal/ci: harden change loader by @masseelch in #916
- cmd/atlas: change migrate apply --to flag to --url by @a8m in #917
- sql/migrate: move call to write-revision after version is set by @masseelch in #918
- cmd/atlas: avoid failing in case there are no migration files to apply by @a8m in #919
- cmd/atlas/internal/cmdapi: miscellaneous changes while running manual testing by @a8m in #920
- sql/sqltool: add basic support for golang directory by @masseelch in #924
- sql/sqltool: fix small typo by @masseelch in #925
- cmd/atlas: support multifile input and directory input schemas by @rotemtam in #921
- sql/postgres: finish support for array types by @a8m in #926
- cmd/atlas: remove replace directive to enable 'go install cmd/atlas' by @a8m in #930
- doc/md: updating install from source instructions by @Phuurl in #927
- cmd/atlas/internal/cmdapi: add dry-run flag to migrate apply by @masseelch in #923
- sql/migrate: export execution state constants by @masseelch in #929
- sql/migrate: improve details on not clean error by @masseelch in #934
- cmd/atlascmd: add supported format for dbmate by @iwata in #931
- cmd/atlas/cmdapi: add migrate status command by @masseelch in #932
- sql/sqlcheck: move analyzers to be driver-specific by @a8m in #937
- cmd/atlas/internal/cmdapi: create migration directory on atlas migrat… by @masseelch in #935
- sql/migrate: introduce Snapshoter interface by @masseelch in #936
- sql/sqlcheck: add datadepend checks for postgres and sqlite by @a8m in #938
- cmd/atlas/internal/cmdapi: support multi to urls for migrate diff by @rotemtam in #940
- sql/postgres: skip comment change in alter column by @a8m in #942
- cmd/atlas/internal/cmdapi: support multi file schemas in project files by @rotemtam in #943
New Contributors
- @omarhachach made their first contribution in #859
- @ndrpnt made their first contribution in #895
- @HatsuneMiku3939 made their first contribution in #863
- @Phuurl made their first contribution in #927
- @iwata made their first contribution in #931
Full Changelog: v0.4.2...v0.5.0