`xata pull <branch>` results in a high number of migration files - Safe to ignore?

This happens after running migrations or pushes with Drizzle. I have been testing different data models and now have over 200 migration files. Is it safe to ignore the folder since we are planning on running all migrations with Drizzle anyways?
3 Replies
kostas
kostas•7mo ago
These migration files support xata pull originbranch and xata push targetbranch commands, enabling workflows such as pulling migrations from a branch and pushing them to another. If you're not planning to use xata migrations and instead you're relying on Drizzle, you can safely gitignore the directory. They can be downloaded any moment either way with xata pull branchname.
Michael Schaufelberger
Michael SchaufelbergerOP•7mo ago
Ok good. Why are there so many? Is every schema change creating a migration file?
kostas
kostas•7mo ago
Assuming you're using a Postgres-enabled db, the migrations files are part of the pgroll service: https://github.com/xataio/pgroll which manages migrations. It is also available as an open-source project to use with on-prem Postgres. The purpose of this service is to provide advanced migration capabilities, like editing of column constraints and eventually type changes. To do so safely, and eventually support more complex scenarios including version rollbacks and rebasing, pgroll tracks every change in migration files. Ultimately we should be able to compact them to avoid an ever-growing directory, but with the current state of things each file represents a schema change as you described, more or less. This project will enable some novel features such as in-place, zero-downtime, schema migrations through concurrent/parallel views. Sorry if I went too verbose here, it's a very exciting project for us 🙂 Here's a demo if you'd like to learn more: https://www.youtube.com/watch?v=IrjL8GReDKQ
Want results from more Discord servers?
Add your server