Should migration.sql files be checked in to git?

I'm not sure if these should be ignored or checked in.
1 Reply
kapa.ai
kapa.ai3d ago
Hi @Webby Vanderhack. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, migration files should be checked into git when working with Wasp projects. Based on the knowledge sources, migrations are considered part of the source code in Wasp. This is evident from issue #105 which states that "migrations/ can also be considered to be part of a source code" Generator should copy migrations folder. Additionally, the discussions in various issues indicate that migrations are meant to be versioned and shared between developers: 1. In issue #211, there's discussion about propagating deletion of migrations from the source to the generated project, which implies migrations are part of the versioned source code Propagate deletion of db migrations. 2. Issue #214 mentions storing "the last migrated checksum in such a way that it is versioned in the Wasp project dir and propagated up/down" which further suggests migrations are meant to be versioned Warn user if Prisma needs to be re-generated. Unlike temporary files created by API endpoints (mentioned in issue #1881), which should be gitignored, migration files represent the evolution of your database schema and should be shared across all development environments. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @Webby Vanderhack, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?

Did you find this page helpful?