Detect Migrations Drift in CI
How to detect schema drift in CI and ensure the migration directory is up to date with the desired schema state - ORM, HCL, SQL, or any other schema definition?
How to detect schema drift in CI and ensure the migration directory is up to date with the desired schema state - ORM, HCL, SQL, or any other schema definition?
A .env
file is a simple text file used to store environment variables for applications. It helps developers manage
configuration settings, such as database credentials, API keys, and other sensitive information, without hardcoding them
into the source code. By using a .env
file, developers can keep their codebase clean, secure, and easily configurable
across different environments.
For developers who want to use .env
files with Atlas, there are two ways users can do so through the standard Atlas
HCL configuration file:
PostGIS is a spatial database extension for PostgreSQL. It adds support for geometric objects, enabling the processing
of spatial data like points, lines, and polygons. After installing PostGIS, the GEOMETRY
data type can be used to define
tables that capture geo-spatial data, for example:
How can I install Atlas, and why is go install
no longer supported?
Developers who use Atlas to run migrations using a golang-migrate
directory format, may run into an errors like:
-- migrating version 20250324061649.down.sql
-> DROP TABLE `users`;
Error 1051 (42S02): Unknown table 'public.users'
With features such as composite schemas, custom rules, schema linting, and more, the atlas.hcl
file can get complex.
To validate or debug the file, you can use print
statements as you commonly would with other languages.
How can I inspect a specific resource, such as a function, view, or table, using the schema --include
flag?
Why does atlas migrate diff
fail with the following error after running atlas migrate apply
?
Error: sql/migrate: connected database is not clean: found table "atlas_schema_revisions" in schema <schema_name>. baseline version or allow-dirty is required
How to generate an SQL schema file from an existing migrations directory to quickly set up a database for integration tests?
How do I fix the ModifySchema is not allowed when migration plan is scoped to one schema
error?