Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up[diesel_cli] There should be a way to provide backend specific migrations #336
Comments
This comment has been minimized.
|
There is a "way" to do this right now, by supplying a migration directory manually. I'm not sure that maintaining schemas on multiple backends in the same code base is a common enough use case to warrant any support beyond that. |
This comment has been minimized.
toudi
commented
Sep 22, 2016
•
|
oh, I was just about to ask the same question :D I actually thought that in the SQL file there could be like a comment section or something, like:
so that if there is no would you accept a PR of such a feature or do you believe that this shouldn't exist / and / or is too dangerous? I am actually very new when it comes to rust, but if I could help, I'd love to |
This comment has been minimized.
|
Closing as I don't see this being a feature that we pursue any time soon. |
weiznich commentedMay 19, 2016
I'm trying to support postgresql and sqlite in my application. To write the migrations for both I need to do some small changes in my migrations. For example changing postgres
BIGSERIAL PRIMARY KEYintoINTEGER PRIMARY KEY.It would be great to allow writing backend specific migrations. For example in each migration directory could be a up.sql file which contains a migration that should be executed on all backends. Or there could be a up.sqlite.sql and a up.pg.sql file which contains backend specific sql for this migration.