db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

[question] squashing migrations into one file (as a dev process) #739

Open eljefedelrodeodeljefe opened 3 years ago

eljefedelrodeodeljefe commented 3 years ago

I'm submitting a...

Current behavior

After some time I want would want to squash all migrations into one file, let alone for searching experience because old migrations become less of interest.

The process would be similar to e.g. pg_dump-ing a new migration and just remove all files. However, pg_dump is vastly environment specific and adds boilerplate only relevant to pg_dump.

Ideally just all files get concatenated and will also not be run on next mig.

Q: Is there any functionality already existing? Or any procedure like this known?

flisboac commented 2 years ago

Do you mean to exclude all previous migrations?

Or you only want to accelerate new migrations with a new baseline?

Flyway has some functionality that's similar to what you're describing, and it's called Baseline migrations. Just so we can understand, does it fit your use case? Or are you proposing something different?