Releases: ariga/atlas
v0.9.0
We are excited to share the v0.9.0 release! π
Atlas v0.9.0 introduces first-class support for SQL, JSON printing, injection of runtime variables, as well as many small improvements.
Read the announcement blogpost
Quick installation
macOS + Linux:
curl -sSf https://atlasgo.sh | sh
Homebrew:
brew install ariga/tap/atlas
Docker:
docker pull arigaio/atlas
Windows
New Features
Use SQL to describe the desired state
Assuming schema.sql
:
-- create table "users
CREATE TABLE users(
id int NOT NULL,
name varchar(100) NULL,
PRIMARY KEY(id)
);
You can now:
atlas schema apply \
--url "mysql://root:pass@localhost:3306/example" \
--to "file://schema.sql" \
--dev-url "docker://mysql/8/example"
SQL and JSON formatting for schema inspection
Atlas can be used to inspect an existing database and print its schema in multiple formats. In this version SQL and JSON were added:
SQL
atlas schema inspect \
--url "mysql://root:pass@localhost:3306/example" \
--log "{{ sql . }}"
JSON
atlas schema inspect \
--url "mysql://root:pass@localhost:3306/example" \
--log "{{ json . }}"
Inject runtime variables to project configuration files
Users may now store database credentials in external resources and pull them into the project configuration file at runtime:
data "runtimevar" "pass" {
url = "awssecretsmanager://<secret>?region=<region>"
}
env "dev" {
src = "schema.hcl"
url = "mysql://root:${data.runtimevar.pass}@host:3306/database"
}
What's Changed
- sql/postgres: support range types by @a8m in #1314
- cmd/atlas: update ariga.io/atlas by @a8m in #1315
- sql: add driver.Version to expose the version of the connected database by @a8m in #1316
- cmd/atlas: Update go.work.sum by @tmc in #1312
- cmd/atlas: initial support for runtimevar as data source by @a8m in #1318
- cmd/atlas: correctly set env.schemas to flags by @a8m in #1319
- doc/project: add runtimevar examples and doc by @a8m in #1320
- sql/mysql: support native-UUID data type for MariaDB since version 10.7.0 by @michaelboke in #1302
- sql/postgres: use shared uuid type by @a8m in #1322
- docs/website/blog: Picking a database migration tool for Go projects in 2023 by @crossworth in #1321
- schemahcl: validate variable type definition by @a8m in #1325
- cmd/atlas: avoid logging errors twice by @a8m in #1328
- cmd/atlas: basic json logging for schema inspect by @a8m in #1329
- doc/md/guides: Add doc about AR101 by @priteshtm in #1323
- doc/md: guide on testing with compose by @rotemtam in #1335
- md/guides: update correct directory struct by @giautm in #1337
- doc/md: inspect a local db in Cloud guide by @hilakashai in #1336
- doc/website/blog: erd and json blog by @rotemtam in #1331
- cmd/atlas: use the shared stateReader in migrate diff command by @a8m in #1338
- doc/website: fix routing by @hilakashai in #1340
- doc/website/blog: add json examples by @rotemtam in #1341
- doc/website: make clickable gif in blog by @hilakashai in #1342
- sql/mysql: implement reverse for DROP TABLE commands by @a8m in #1345
- sql: support multi-statement reverse commands by @a8m in #1346
- schemahcl: add support for quoted references by @a8m in #1348
- sql/mysql/mysqlversion: ignore server build info on compare by @a8m in #1350
- schemahcl: scan and format quoted identifiers by @a8m in #1353
- doc/blog: atlas wilco quest announcement by @rotemtam in #1356
- doc/blog: remove image from old post by @rotemtam in #1357
- doc: component for installation instructions by @masseelch in #1354
- cmd/atlas: extend sql state-reader to accept single files by @a8m in #1358
- doc/install: add docker to instructions component by @a8m in #1359
- cmd/atlas: add --log=sql to allow dumping sql schema on inspection by @a8m in #1360
- cmd/atlas/docker: pass user query params to driver by @a8m in #1362
- cmd/atlas: make schema diff output valid to execute by @a8m in #1363
- cmd/atlas: remove short form for --to flag by @a8m in #1364
- cmd/atlas: gracefully exit on interrupts by @a8m in #1365
- doc: add examples to readme by @a8m in #1366
- doc: add sql to getting started by @a8m in #1367
- doc/md: Fly.io guide by @crossworth in #1361
- doc: changing atlas newsletter link to Substack by @shani-a in #1369
- doc/md: fix flyio paths by @rotemtam in #1370
- doc: update inspection doc by @a8m in #1371
- cmd/atlas: hide -f in 'schema apply' and improve --to comment by @a8m in #1372
- doc: update schema apply doc with sql examples by @a8m in #1374
- doc: add sql examples to 'schema diff' page by @a8m in #1376
- .github/workflows: create quick boot mysql images by @ronenlu in #1375
- .github: add popular mysql tags to builds by @a8m in #1378
- cmd/atlas/docker: use mysql/mariadb images that boot up faster by @a8m in #1379
- cmd/atlas: dynamically create mysql databases by @a8m in #1381
- sql/postgres: always create 'public' schemas with IF NOT EXISTS clause by @a8m in #1382
- sql: add default migration planners by @a8m in #1383
- sql/mysql: setup version for default differ by @a8m in #1384
- doc/diff: add sql schema to examples by @a8m in #1385
- sql/sqlite: in inspect command order columns by cid by @ronenlu in #1387
- doc/blog: v0.9.0 release by @a8m in #1390
New Contributors
- @michaelboke made their first contribution in #1302
- @crossworth made their first contribution in #1321
Full Changelog: v0.8.3...v0.9.0
v0.8.0
We are excited to share the v0.8.0 release! π
Atlas v0.8.0 is a minor release that includes many small improvements and a few major features to migration linting, execution, schema inspection, and project configuration.
Multi-Tenancy/Environment Support
Users can now execute migrations in multi-tenant environments using Atlas configuration language. Read more on Atlas' website.
data "sql" "tenants" {
url = var.admin_url
query = "SELECT `name` FROM `admin`.`tenants`"
}
env "prod" {
for_each = toset(data.sql.tenants.values)
url = "${local.tenant_url}/${each.value}"
migration {
dir = "file://migrations"
}
}
Custom Logging
The --log
option has been added to the migrate apply
and migrate status
commands. By using this option, users can customize the output of the execution.
env "prod" {
for_each = toset(data.sql.tenants.values)
url = "${local.base_url}/${each.value}"
log {
migrate {
// Print a JSON log containing the tenant's name.
apply = format(
"{{ json . | json_merge %q }}",
jsonencode({
Tenant : each.value
})
)
}
}
}
Migration Troubleshooting
The schema diff
and migrate status
commands have been extended to help troubleshoot and fix migration failures in production. Read the full guide here.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.8.1
chmod +x ./atlas-darwin-amd64-v0.8.1
sudo mv ./atlas-darwin-amd64-v0.8.1 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.8.1
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.8.1 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.8.1
docker run --rm arigaio/atlas:0.8.1
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
- cmd/atlas: update atlas package by @a8m in #1139
- sql/migrate: support the mysql client DELIMITER command by @a8m in #1140
- resolving error caused while moving ddl file by @priteshtm in #1142
- cmd/atlas: do not drop public schema on pg by @a8m in #1149
- sql/sqlcheck/datadepend: report column nullability changes that might fail by @a8m in #1150
- cmd/atlas/internal/cmdapi: add atlas migrate import command by @masseelch in #1147
- cmd/atlas/internal/cmdapi: remove force flag by @masseelch in #1152
- sql/postgres: Add support for concurrent indexes by @ivanvanderbyl in #1153
- sql/migrate: gracefully handle missing migration files by @masseelch in #1158
- cmd/atlas/internal/cmdapi: add atlas migrate set-revision by @masseelch in #1159
- sql/sqlite: toggle foreign-keys pragma before opening transactions by @a8m in #1162
- cmd/atlas: update atlas package by @a8m in #1163
- sql/sqlite: check foreign keys once before committing a transaction by @masseelch in #1164
- sql/sqlite: only check foreign-keys in before transaction commit, if β¦ by @masseelch in #1165
- cmd/atlas/internal/migrate: template based migrate status by @masseelch in #1166
- cmd/atlas/internal/cmdapi: vercheck for updates by @rotemtam in #1167
- schemahcl: support dynamic resource blocks by @a8m in #1170
- schemahcl: accept list(T) as inputs by @a8m in #1172
- schemahcl: support assigning variable inputs of type list to attributes by @a8m in #1173
- schemahcl: add support for the for_each meta argument and stdlib functions by @a8m in #1175
- cmd/atlas/internal/cmdapi: add format query parameter to migration dir URL by @masseelch in #1174
- cmd/atlas/internal/cmdapi: schema diff works with statereaders by @masseelch in #1177
- schemahcl: add support for datasource and locals by @a8m in #1180
- cmd/atlas/internal/cmdapi/migrate: set dir value from env in migrate command by @unknowingknow in #1182
- cmd/atlas/internal/cmdapi: no longer use global variables for command⦠by @masseelch in #1179
- cmd/atlas: update atlas pkg by @a8m in #1188
- cmd/atlas/internal/cmdapi: add dir-format flag to migrate lint by @masseelch in #1189
- sql/postgres: support inspecting domains as user-defined types by @a8m in #1190
- sql/internal/specutil: add index-part attributes to spec by @a8m in #1194
- cmd/atlas: support multi env blocks in 'migrate apply' by @a8m in #1198
- cmd/atlas/internal/cmdapi/migrate: refactor report code in preparatio⦠by @masseelch in #1199
- sql/internal: check balanced quoting by @giautm in #1197
- cmd/atlas: add 'sql' data-source to config files by @a8m in #1200
- internal/integration: add example for sql data sources on mysql and postgres by @a8m in #1202
- sql/mysql: ignore innodb schema on inspection by @a8m in #1206
- internal/integration: name docker containers by @masseelch in #1209
- cmd/atlas/internal/cmdapi: make migrate apply logging template based by @masseelch in #1205
- schemahcl: support decoding struct fields by @a8m in #1210
- cmd/atlas: support multi-env logging by @a8m in #1211
- sql/sqlclient: remove DSN from the JSON output by @giautm in #1214
New Contributors
- @priteshtm made their first contribution in #1141
- @ivanvanderbyl made their first contribution in #1153
- @unknowingknow made their first contribution in #1182
- @dito made their first contribution in #1191
Full Changelog: v0.7.0...v0.8.0
v0.7.0
Atlas v0.7.0 is a minor release that includes many small improvements and two major features that were added:
- Atlas migration executor that allows applying migration files on databases. Read more about it in the Atlas blog: https://atlasgo.io/blog/2022/09/05/announcing-migration-execution.
- We are also happy to announce the official Atlas GitHub Action which can be used to integrate migration directory linting to your teamβs existing continuous integration flow. The action can lint migration directories for Atlas projects as well as for other popular migration tools such as Flyway, Liquibase, and golang-migrate.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.7.0
chmod +x ./atlas-darwin-amd64-v0.7.0
sudo mv ./atlas-darwin-amd64-v0.7.0 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.7.0
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.7.0 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.7.0
docker run --rm arigaio/atlas:0.7.0
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.
Full Changelog: v0.6.0...v0.7.0
v0.6.0
Atlas v0.6.0 is a minor release that includes many small improvements to the Atlas CLI, as well as official support for versioned migration authoring using the atlas migrate diff
command.
Versioned Migration Authoring is an attempt to combine the simplicity and expressiveness of the declarative approach with the control and the explicitness of versioned migrations.
With versioned migration authoring, users still declare their desired state and use the Atlas engine to plan a safe migration from the existing to the new state. However, instead of coupling planning and execution, plans are instead written into normal migration files which can be checked into source control, fine-tuned manually and reviewed in regular code review processes.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.6.0
chmod +x ./atlas-darwin-amd64-v0.6.0
sudo mv ./atlas-darwin-amd64-v0.6.0 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.6.0
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.6.0 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.6.0
docker run --rm arigaio/atlas:0.6.0
New Features
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
- sql/postgres: support creating and deleting serial columns by @a8m in #945
- doc/website/blog: v0.5.0 announcement blog post by @rotemtam in #944
- sql/migrate: change execution logic by @masseelch in #939
- internal/integration: enabled missing tests by @masseelch in #933
- doc/website/blog: add all posts to side nav by @hilakashai in #946
- sql/migrate: utilize partial hashes to check for changes in applied s⦠by @masseelch in #947
- cmd/atlas/internal/cmdapi: update migrate status command to be aware of partially applied files by @masseelch in #948
- cmd/atlas/internal/cmdapi: update migrate status command to be aware β¦ by @masseelch in #949
- cmd/atlas/internal/cmdapi: url attr optional in env by @rotemtam in #950
- doc/website/src: remove UI from landing page by @hilakashai in #951
- chore: cleanup by @sashamelentyev in #952
- chore: change error by @sashamelentyev in #953
- sql/postgres: support modifying serial columns by @a8m in #954
- Docknowledge by @a8m in #955
- doc/website: remove padding for list items when screen < 400px by @a8m in #956
- doc/website: remove social media icons from navbar by @a8m in #957
- sql/postgres: support for postgresql by @vsychov in #958
- doc/website: add serial types to knowledge pages by @a8m in #959
- sql/mysql: add support for sized bit types by @a8m in #960
- doc/website: add GoDoc to footer by @hilakashai in #961
- Feat/doc reorg by @hilakashai in #962
- sql/postgres: respect bit length by @a8m in #965
- doc: refactor column types page by @a8m in #963
- doc/website: initial work on postgres column types by @a8m in #966
- sql/postgres: support the alias float type by @a8m in #967
- doc/website: remove ui and deployment from side nav by @hilakashai in #968
- doc: add integrations by @hilakashai in #969
- doc: move CLI reference by @hilakashai in #971
- sql/postgres: cross schema enums by @a8m in #970
- doc: add concepts by @hilakashai in #972
- sql/postgres: delete dangling enum types by @a8m in #974
- sql/postgres: ensure enums are dropped only once by @a8m in #975
- sqlite: miscellaneous changes (doc, migrate, sqlspec) by @a8m in #976
- sql/sqlspec: delete unused migratespec by @a8m in #978
- schemahcl: fixed invalid identity token by @giautm in #980
- doc: reorganize SQL docs by @hilakashai in #973
- cmd/atlas: extend error columns in revisions table to text by @a8m in #981
- docs: fix footer link by @hilakashai in #982
- doc/md/concepts: declarative vs versioned migrations by @rotemtam in #983
- sql/migrate: merge Dir and Scanner to one interface by @a8m in #984
- cmd/atlas: update atlas pkg by @a8m in #985
- sql/migrate: initial work on baseline migrations by @a8m in #986
- cmd/atlas: support --revisions-schema in project file by @ronenlu in #987
- sql/migrate: allow setting --from and --baseline versions by @a8m in #988
- cmd: Drop -w flag from atlas commands by @ronenlu in #991
- cmd/atlas: migrate dir format by @a8m in #992
- cmd/atlas: update ariga.io/atlas by @a8m in #993
- cmd/atlas/internal: auto populate parseTime option for mysql connections by @a8m in #995
- Grammer fix by @gneyal in #997
- doc/getting-started: fix referencing table by @gneyal in #998
- sql/migrate: only take .sql files into the sumfile by @ronenlu in #1002
- sql/internal/sqlx: exclude resources based on patterns by @a8m in #1003
- doc/md: declarative migration workflow docs by @rotemtam in #1000
- docs/md: migrate diff by @rotemtam in #1005
- cmd/atlas: support multiple schemas in env file by @a8m in #1007
- doc/md: examples for schema inspect by @rotemtam in #1006
- doc/md: fix link by @hilakashai in #1004
- doc: update algolia API by @hilakashai in #1010
- cmd/atlas: support --exclude option in schema command by @a8m in #1009
- doc/md/versioned: migrate lint docs by @rotemtam in #1011
- schemahcl: dont allow empty str sql() expr by @rotemtam in #1008
- doc/website: keep sidebar title shorter by @a8m in #1012
- doc: add --exclude command to inspect page by @a8m in #1013
- doc/md/versioned: new command by @rotemtam in #1015
- sql/migrate: store baseline migrations in history table by @a8m in #1016
- sql/sqlite: expand DEFAULT args in plan statements by @a8m in #1017
- cmd/atlas: allow storing revisions with zero total by @a8m in #1019
- doc/md/declarative: atlas schema diff examples by @rotemtam in #1020
- sql/migrate: allow running 'migrate diff' against a schema connection by @a8m in #1021
- cmd/atlas: add verbose steps information to lint command by @a8m in #1025
- cmd/atlas: update atlas package by @a8m in #1026
- sql/mysql: report error in case table has no columns by @a8m in #1028
- internal/integration: add testscript for cli migrate diff by @masseelch in #1027
- cmd/atlas: improve error reporting on lint by @a8m in #1032
- internal/integration: scripttests for migrate apply by @masseelch in #1030
- internal: database connections for a test are established in the test⦠by @masseelch in #1031
- sql/migrate: skip adding table qualifiers when connection/work is scoped to a schema by @a8m in #1035
- sql/internal/sqlx: add check to prevent misuse of schema qualifiers by @a8m in #1040
- cmd/atlas: remove unused verbose flag by @a8m in #1043
- internal/integration: finish testing for migrate diff by @a8m in #1041
- cmd/atlas: accept custom table qualifier in migrate diff command by @a8m in https://g...
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/s...
v0.4.2
Atlas v0.4.2 is a patch release that includes many small improvements to the Atlas CLI and introduces preview support for CockroachDB.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.4.2
chmod +x ./atlas-darwin-amd64-v0.4.2
sudo mv ./atlas-darwin-amd64-v0.4.2 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.4.2
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.4.2 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.4.2
docker run --rm -p 5800:5800 arigaio/atlas:0.4.2
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
- cmd/atlascmd: better err message when missing required var by @rotemtam in #813
- doc/blog: announcing atlas projects by @rotemtam in #812
- sql/postgres: return err on alter failure by @hedwigz in #817
- sql/crdb: basic driver and empty tests by @hedwigz in #814
- sql/cockroach: make postgres inspect compatible with crdb by @hedwigz in #815
- doc/blog: change date for v041 post by @rotemtam in #818
- Revert "sql/cockroach: make postgres inspect compatible with crdb" by @hedwigz in #819
- Revert "Revert "sql/cockroach: make postgres inspect compatible with crdb"" by @hedwigz in #820
- sql/crdb: add crdb diff logic by @hedwigz in #816
- sql/postgres: move cockroach logic to its own file by @a8m in #822
- doc: replace dsn leftovers with url format by @a8m in #823
- doc/website: fix a link to the Terraform blog post by @adambabik in #824
- sql/crdb: some integration tests by @hedwigz in #826
- cmd/atlascmd/migrate: introduce SchemaChanger interface by @masseelch in #831
- sql/crdb: ent integration test by @hedwigz in #829
- sql/postgres: use ordinal_position for pg_index_column_has_property instead of column index by @a8m in #833
- doc/md: fix flag to -u by @hilakashai in #835
- sql/postgres: skip partitions on table inspections by @a8m in #836
- sql/crdb: all integration tests by @hedwigz in #830
- sql/sqlclient: add support for transactions by @masseelch in #837
- doc/website: fix the footer title color by @elad-n in #838
- internal/integration: add ent-revision test to cockroach db by @masseelch in #843
- doc: updating text related to license by @rotemtam in #827
- sql/migrate: refactor execution (in preparation for transactions) by @masseelch in #844
- cmd/atlascmd: fix schema selection from env by @rotemtam in #842
- sql/sqlclient: use shared driver instance for different flavors by @masseelch in #845
- ci: use our crdb image by @hedwigz in #841
- internal/ci: use git to detect new migration files in ordert to load them into⦠by @masseelch in #825
- ci: fix cockroach service by @hedwigz in #846
- cmd/atlasci/ci: support loading migration changes by @a8m in #847
New Contributors
- @adambabik made their first contribution in #824
Full Changelog: v0.4.1...v0.4.2
v0.4.1
Atlas v0.4.1 is a patch release that includes small improvements and introduces support for Project Files.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.4.1
chmod +x ./atlas-darwin-amd64-v0.4.1
sudo mv ./atlas-darwin-amd64-v0.4.1 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.4.1
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.4.1 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.4.1
docker run --rm -p 5800:5800 arigaio/atlas:0.4.1
New Features
In this version, we added a new concept called project files. Project files provide a way to describe and interact with multiple environments while working with Atlas. A project file is a file named atlas.hcl
and it contains multiple env
blocks, each describing an environment. Each environment has a reference to where the schema definition file resides, a database URL and an array of the schemas in the database that are managed by Atlas.
// Define an environment named "local"
env "local" {
// Declare where the schema definition file resides.
src = "./schema/project.hcl"
// Define the URL of the database which is managed in
// this environment.
url = "mysql://localhost:3306"
// Define the URL of the Dev Database for this environment
// See: https://atlasgo.io/dev-database
dev = "mysql://localhost:3307"
// The schemas in the database that are managed by Atlas.
schemas = ["users", "admin"]
}
env "dev" {
// ... a different env
}
Environments may also declare a migration_dir
block to configure how versioned migrations work in the specific environment.
env "local" {
// ..
migration_dir {
// URL where the migration directory resides. Only filesystem directories
// are currently supported but more options will be added in the future.
url = "file://migrations"
// Format of the migration directory: atlas | flyway | liquibase | goose | golang-migrate
format = atlas
}
}
That way, when running atlas migrate
commands, the environment can be worked against using the --env
flag.
atlas migrate validate --env local
Project files can also pass and declare input values.
env "local" {
url = "sqlite://test?mode=memory&_fk=1"
src = "./schema.hcl"
// Other attributes are passed as input values to "schema.hcl":
tenant = "rotemtam"
}
These values can then be consumed by variables defined in the schema file:
variable "tenant" {
type = string
}
schema "main" {
name = var.tenant
}
For a more thorough explanation and examples of the new project files, click here.
What's Changed
- internal/integration: testscript for migration dirs by @rotemtam in #790
- sql/sqlite: simple file lock to implement schema.Locker for SQLite by @masseelch in #791
- cmd/atlascmd: move and fix test for version command and build by @masseelch in #792
- cmd/atlascmd: acquire a lock before executing migrations by @masseelch in #781
- sql/migrate: introduce basic execution logging by @masseelch in #793
- doc/website: add Algolia search bar by @hedwigz in #794
- doc/md: update UI docs by @hilakashai in #800
- sql/sqlclient: expose registered name by @masseelch in #796
- Update README.md by @hilakashai in #802
- sql/mysql: Attempt a fix for RawExpr cases by @ofpiyush in #797
- doc/md: update UI command docs by @hilakashai in #801
- cmd/atlas: avoid printing help messages on Run errors by @a8m in #804
- cmd/atlascmd: env support for migrate commands by @rotemtam in #799
- sql/mysql: move charset writing to data_type stage by @a8m in #806
- cmd/atlas: support input variables for project files by @rotemtam in #807
New Contributors
Full Changelog: v0.4.0...v0.4.1
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.
v0.4.0
Starting from this release, we are separating the Atlas CLI and the Management UI. The official release will be much more lightweight and the UI will be shipped in a different tagged binary.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.4.0
chmod +x ./atlas-darwin-amd64-v0.4.0
sudo mv ./atlas-darwin-amd64-v0.4.0 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.4.0
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.4.0 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.4.0
docker run --rm -p 5800:5800 arigaio/atlas:0.4.0
New Features
In this version, we added support for block range indexes.
index "idx" {
type = BRIN
columns = [column.range]
page_per_range = 128
}
What's Changed
- sql/postgres: add support for block range indexes by @a8m in #788
- internal/integration: testscript for cli tests by @rotemtam in #779
- cmd/atlascmd: extend atlas migrate validate documentation by @masseelch in #784
- cmd/atlascmd: support project file in inspect by @rotemtam in #771
Full Changelog: v0.3.8...v0.4.0
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.
v0.3.8
Atlas v0.3.8 is a patch release that includes many small improvements to the Atlas CLI.
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.3.8
chmod +x ./atlas-darwin-amd64-v0.3.8
sudo mv ./atlas-darwin-amd64-v0.3.8 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.3.8
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.3.8 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.3.8
docker run --rm -p 5800:5800 arigaio/atlas:0.3.8
New Features
Atlas DDL
This version includes several new features:
Generated Columns - Following requests from our community, we added support for generated columns in MySQL, PostgreSQL, and SQLite. Generated columns are columns whose values are computed using other columns or by deterministic expressions. Click here to see examples on how to implement these columns.
Partitions - Another requested feature from our community was support for partitioned tables in PostgreSQL. In this version, we added support for PostgreSQL only, but are planning on adding support for the remaining dialects in the future. Table partitioning refers to splitting large, logical tables into smaller, physical ones. To view an example of how to implement partitions, click here.
Input variables - We added support for input variables to allow reusing an Atlas schema in multi-environment architecture. This is especially useful when the database schema is replicated per tenant. Once input variables are defined, their value can be referenced and passed on in the schema apply
command using the --var
flag. Read more about input variables here.
What's Changed
- sql/postgres: respect case sensitive names for schema resources by @a8m in #638
- cmd/action: add migrate diff command by @masseelch in #636
- doc/website: add a page for dev-database / twin-environment by @a8m in #640
- doc/sql: document index expressions and partial indexes by @a8m in #641
- sql/mysql: add support for index prefixes by @a8m in #642
- doc/md: documenting creation of encryption keys by @rotemtam in #643
- doc/website: mysql and maria index prefixes by @a8m in #644
- doc/md: remove redundant paragraph from encryption section by @rotemtam in #645
- sql: introduce schema.Locker by @a8m in #646
- sql/postgres: implement schema.Locker by @a8m in #648
- sql/tidb: working ent integration tests by @hedwigz in #604
- cmd/action: migrate tests by @masseelch in #649
- internal/integration: add tests for pg enums with default values by @a8m in #652
- internal/integration: add tests for columns with default values by @a8m in #653
- internal/docker: docker client to spin up containers on the fly by @masseelch in #651
- cmd/action: make sure to close database connections by @masseelch in #654
- cmd/action: keep same comment format by @masseelch in #655
- internal/integration: speed up test execution by @masseelch in #656
- cmd/action: add user explanation when checksum mismatch occur by @masseelch in #658
- cmd/action: fix data race issue in test by @a8m in #660
- cmd/action: add migrate validate command to check migration integrity⦠by @masseelch in #659
- cmd/action: tests for atlas migrate validate command by @masseelch in #661
- doc/md: add TiDB to various docs by @hedwigz in #650
- cmd/action: add atlas migrate hash command to solve checksum mismatches by @masseelch in #662
- sql/migrate: GlobStateReader will now try to get a lock before replay⦠by @masseelch in #663
- sql/postgres: add missing comma in column changes for reverse changes in Postgres by @tprebs in #668
- sql/internal/sqlx: keep table self references on plan by @a8m in #669
- Update UI docs by @hilakashai in #670
- doc/md: replacing mysql dsn with urls by @rotemtam in #671
- cmd/action: add docker provider by @masseelch in #665
- schema/schemaspec: adding qualifier label to blocks by @rotemtam in #672
- schema/schemaspec: marshal qualifers by @rotemtam in #673
- schema/schemaspec: support refs for qualified resources by @rotemtam in #674
- sql/postgres: correctly return nil realm if there are no schemas in t⦠by @masseelch in #675
- cmd/action: add MariaDB and PostgreSQL support for docker driver by @masseelch in #676
- cmd/action: add --verbose flag to apply command and document docker driver by @masseelch in #678
- sql/internal/specutil: support references to qualified tables by @rotemtam in #677
- sql/migrate: harden atlas.sum file integrity by @masseelch in #681
- sql: qualify tables with duplicate names when marshaling by @rotemtam in #679
- .github/workflows: fix ci by @rotemtam in #683
- doc/md/ddl: document qualified tables by @rotemtam in #685
- sql/postgres: use native pg time types by @a8m in #686
- sql/postgres: fix the way time with(out) precision are parsed by @a8m in #687
- sql/schema: use pointer for time precision by @a8m in #690
- sql/schema: add support for controlling the amount/depth of inspection by @a8m in #692
- sql/migrate: golang-migrate and goose support by @masseelch in #693
- internal/tool: add templates for flyway compatible migration files by @masseelch in #694
- internal/tool: add templates for liquibase compatible migration files by @masseelch in #696
- internal/tool: no need for constructors by @masseelch in #697
- sql/tool: export internal/tool for availability in other packages by @masseelch in #698
- sql/mysql: support inspecting and applying generated columns by @a8m in #699
- sql/internal/specutil: support input variables by @rotemtam in #700
- sql/mysql: support marshaling generated columns by @a8m in #701
- sql/mysql: support unmarshaling generated columns by @a8m in #703
- sql/migrate: local files can be created with read permissions for eve⦠by @masseelch in #702
- sql/migrate: local-directory does not create a directory if it does n⦠by @masseelch in #705
- internal/types: move typeregistry outside sql by @rotemtam in #704
- internal/integration: initial testscripts for mysql generated columns by @a8m in #706
- schema/schemaspec/schemahcl: handle input variables by @rotemtam in #707
- internal/integration: add tests for comparing inspected generated columns by @a8m in #708
- sql/mysql: support diffing generated columns by @a8m in #710
- sql/mysql: improve alter table generation by @a8m in #712
- sql/mysql: simplify alter table function by @a8m in #713
- sql/mysql: apply changes to generated columns by @a8m in #716
- internal/integration: add testscript cases for generated columns changes by @a8m in #717
- sql/postgres: fixed invalid postgres DSN by @svstanev in #714
- sql/postgres: marshal spec duplicate enum entries by @svstanev in #718
- sql/postgres: inspect generated expresion attribute for columns by @a8m in #719
- sql/postgres: apply generate columns for new columns by @a8m in #721
- sql/postgres: support (un)marshal generated columns by @a8m in #723
- schema/schemaspec: support defining resource names as attr by @rotemtam in #720
- sql/postgres: fixed inspection of multicolumn indexes by @svstanev in #715
- sql/postgres: support dro...
v0.3.7
Atlas v0.3.7 is a patch release that includes many small improvements to both the Atlas CLI and the Management UI.
This version introduces several new features:
Persistent storage encryption
In this version, we enabled encryption of sensitive fields when using atlas serve
against a persistent storage. Atlas uses tink, a battle-tested encryption library created at Google, to encrypt information.
Following recommendations from the developers of tink, Atlas uses AEAD encryption with an AES256_GCM type key.
Docker image
Following requests from the community and to enable easier deployment of Atlas to your team's cloud account, starting from this version on, an official Atlas image is available on DockerHub.
The image is based on Distroless, a bare-bones base Docker image for improved security and smaller download size.
To get the Atlas CLI with management UI image, run from the command line:
# latest
docker pull arigaio/atlas:latest
# tagged version
docker pull arigaio/altas:0.3.7
To run Atlas in serve
mode against persistent storage using Docker:
# mount the encryption key to persist it between runs, note that is an example for macOS.
docker run -v $HOME/.atlas/keyset.json:/root/.atlas/keyset.json -p 5800:5800 arigaio/atlas serve --storage "mysql://root:[email protected]:3306/atlas"
In addition, we've enhanced the "Activity & History" view with a brand new design and some minor UI fixes.
Changelog:
- Persistent storage encryption by @yonidavidson
- New Activity & History by @elad-n & @rotemtam
- Docker image by @zeevmoney
Installation
MacOS
curl -LO https://release.ariga.io/atlas/atlas-darwin-amd64-v0.3.7
chmod +x ./atlas-darwin-amd64-v0.3.7
sudo mv ./atlas-darwin-amd64-v0.3.7 /usr/local/bin/atlas
sudo chown root: /usr/local/bin/atlas
Linux
curl -LO https://release.ariga.io/atlas/atlas-linux-amd64-v0.3.7
sudo install -o root -g root -m 0755 ./atlas-linux-amd64-v0.3.7 /usr/local/bin/atlas
Windows
Docker
docker pull arigaio/atlas:0.3.7
docker run -p 5800:5800 arigaio/atlas:0.3.7
What's Changed
- sql/postgres: fix statements generation when IfExists/IfNotExists is used by @a8m in #601
- sql/postgres: support capital tables by @kinggor1010 in #600
- sql/TiDB: break down alter statements by @hedwigz in #596
- sql: add twin-driver and support postgres normalize by @a8m in #602
- cmd/atlas: rename dsn to url by @a8m in #605
- sql/tidb: add more integration tests by @hedwigz in #603
- sql/sqlx: replace md5 hash and run gosec on ci by @hedwigz in #607
- cmd/atlas: add support for simple mysql url format by @a8m in #608
- doc/md: improve url doc by adding examples by @a8m in #609
- cmd/atlas: introduce the dev-url to apply command by @a8m in #611
- internal/integration: enable schema normalization in script tests by @a8m in #612
- cmd/action: make env command public by @zeevmoney in #613
- sql/mysql: fix mysql information_schema escaping by @a8m in #615
- sql/migrate: (BC) read from state from migration directory instead of an extra state reader by @masseelch in #616
- cmd/atlas: add atlas serve docs by @yonidavidson in #618
- sql/internal/sqlx: rename TwinDriver to DevDriver by @a8m in #617
- serving docs part 2 by @yonidavidson in #619
- sql/mysql: support index expressions by @a8m in #620
- sql: remove dead code by @a8m in #621
- sql/postgres: support index expressions by @a8m in #622
- Update docusaurus.config.js by @a8m in #628
- cmd/action: change defualt listen address to work on all cases by @zeevmoney in #627
- Default value of string like field can be empty string
""
or"null"
by @fishead in #626 - sql/sqlite: initial support for index expression scanning by @a8m in #629
- sql: use smarter approach to ensure expressions are wrapped by @a8m in #630
- sql/sqlite: add support for index expressions on migrate by @a8m in #631
- sql/migrate: add hash integrity file by @masseelch in #624
- cmd/action: use cobra context to cancel operations on interrupt / kill by @masseelch in #632
- sql/internal/specutil: fix empty ondelete or onupdate in fk by @zeevmoney in #633
New Contributors
- @kinggor1010 made their first contribution in #600
- @fishead made their first contribution in #626
Full Changelog: v0.3.6...v0.3.7