Skip a migration for specific database url (dev/prod) #454
Replies: 3 comments
-
If it loads against the existing schema, you can use any tooling for the job, including putting it into a separate folder and using dbmate against that folder. If the data needs to be loaded at a particular point of a past schema then this feature doesn't exist in dbmate. There is a PR for templating variables and with that feature it might be possible to write an if statement into the migration. |
Beta Was this translation helpful? Give feedback.
-
@ajaishankar Take a look at #424, which was implemented in #428. Does that address your need? |
Beta Was this translation helpful? Give feedback.
-
The approach I had followed was what @gregwebs suggested. Put seed data in a separate I really did not really need merging since ours was a pretty simple app (schema in one directory, dev seed data in another) Thanks everyone for such a nice and simple migration tool! Ajai |
Beta Was this translation helpful? Give feedback.
-
Hi
Is there a way to not run a migration based on database url?
For example I have a migration file to seed some (test) data in the development database.
But I do not want to run this migration file on production.
Is there a some strategy we could use to enable this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions