ariga / atlas

Manage your database schema as code
https://atlasgo.io
Apache License 2.0
5.94k stars 265 forks source link

`atlas migrate lint` takes very long #3077

Open nakamasato opened 2 months ago

nakamasato commented 2 months ago

I'm using atlas with versioned migration.

When having many large sql files (e.g. manually created DML files with thousands of rows), atlas migrate lint takes very long.

Even though I use atlas migrate set to set the schema as latest as possible, altas migrate lint is very slow. It would be better if atlas migrate lint only checks for the new files to be applied.

rotemtam commented 2 months ago

Migrate lint always replays all migrations on an empty database, so it is expected to run any statement in these files. This is done to bring the db to the current state before applying any new migrations.

This can be somewhat circumvented using checkpoints, but I'm not certain it is applicable in your use case.

https://atlasgo.io/versioned/checkpoint