Atlas v0.3.2 is a patch release that includes many small improvements to both the Atlas CLI and the Management UI.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.3.2
chmod +x ./atlas-darwin-amd64-v0.3.2
sudo mv ./atlas-darwin-amd64-v0.3.2 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.3.2
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.3.2 /usr/local/bin/atlas
Windows
New Features
Dry-run mode for apply
Dry run mode connects to the target database and prints the SQL migration to bring the target database to the desired state without prompting the user to approve it.
atlas schema apply -d <dsn> -f <file> --dry-run
Multi-schema support
Previously users could select a single schema from a database to be inspected or applied, with this improvement users can omit the schema from the DSN to inspect all schemas, or specify multiple schemas using the --schema
(or -s
shorthand) flag.
Inspect:
atlas schema inspect -d "mariadb://user:pass@tcp(localhost:3306)/" --schema=schemaA,schemaB -s schemaC
Apply:
atlas schema apply -d "mysql://user:pass@tcp(localhost:3306)/" -f atlas.hcl --schema prod --schema staging
schema fmt
This versions adds a new command, atlas schema fmt
that can be used to provide basic formatting capabilities to .hcl
files.
atlas schema fmt [path]
schema diff
atlas schema diff
connects to two given databases, inspects them, calculates the difference in their schemas, and prints a plan of SQL queries to bring the "from" database to the schema of the "to" database.
What's Changed
CLI
- sql/mysql: CHECK constraints are ENFORCED by default by @a8m in #455
- sql: skip CHECK expression comparison in diff step by @a8m in #456
- cmd/atlas: support canary version: update canary logic by @yonidavidson in #454
- doc/md: fix broken link to CLI documentation by @vladdoster in #459
- doc/md/ui: improving management ui doc page by @rotemtam in #450
- doc/md: bump latest binary version by @rotemtam in #453
- readme: update download link by @rotemtam in #460
- doc/md: fmt consistency and update phrasing by @vladdoster in #461
- doc/md: add headers, update phrasing, formatting by @vladdoster in #463
- cmd/action: add dry run option to schema apply by @rotemtam in #467
- internal/integration: initial testing using testscript by @a8m in #466
- cmd/action: Parse schema name in postgres dsn by @CGA1123 in #470
- doc/website: fix sql-types generation and add information about postg… by @masseelch in #473
- sql/mysql: inspect: support fractional seconds precision in timestamp… by @masseelch in #474
- sql/postgres: inspect: support fractional seconds precision in timest… by @masseelch in #476
- sql/postgres: add timestamptz to type-registry by @a8m in #477
- internal: move typedoc to its own package by @a8m in #478
- sql/mysql: support marshal time types precision in HCL by @masseelch in #479
- internal/integration: test foreign-key action modification by @a8m in #480
- sql/sqlite: inspect index sort order by @a8m in #483
- sql/mysql: add support for bool/boolean types by @a8m in #482
- doc/md: update release notes to latest by @yonidavidson in #475
- sql/mysql: support marshal on update expressions in HCL by @masseelch in #486
- cmd/action: atlas schema diff command implementation by @rotemtam in #484
- sql: move the index DESC attribute to schema.Index by @a8m in #489
- sql/mysql: support unmarshal on update expressions in HCL by @masseelch in #487
- specutil/convert: fix panic on missing schema ref in table block by @zeevmoney in #488
- sql/mysql: fulltext indexes contain NULL collation by @a8m in #492
- cmd/action: add schema fmt command by @rotemtam in #491
- sql/mysql: use one form for printing boolean types by @a8m in #493
- sql/mysql: add reverse to DropIndex by @hedwigz in #452
- atlas: remove uneeded file by @rotemtam in #494
- sql/sqlspec: support unmarshaling index-part by @a8m in #495
- cmd/action: add schema flag by @yonidavidson in #490
- cmd/action: multi path support for fmt by @rotemtam in #496
- schema/schemaspec: add custom printer for string representation override by @masseelch in #497
- sql/mysql: support reverse drop fk by @hedwigz in #498
- cmd/action: allow diffing schemas with different names by @rotemtam in #499
- cmd/action: support multi schema apply by @rotemtam in #503
- sql/sqlspec: support marshaling index key parts by @a8m in #504
- schema/schemspec/schemahcl: remove redundant comma when printing lists by @a8m in #505
- sql/postgres: minor fixes for postgres before release by @a8m in #507
- sql/postgres: support drop index reverse by @hedwigz in #506
- cmd/action: change schema apply behavior by @yonidavidson in #509
- sql/postgres: support drop fk reverse by @hedwigz in #512
Management UI
- Added edge labels to the ERD by @hedwigz
New Contributors
- @vladdoster made their first contribution in #459
- @CGA1123 made their first contribution in #470
- @hedwigz made their first contribution in #452
Full Changelog: v0.3.1...v0.3.2