Skip to content

Different migrations for different DB types? #4403

Answered by weiznich
duckfromdiscord asked this question in Q&A
Discussion options

You must be logged in to vote

How does this translate to diesel, is this the same as a migration?

It's up to you how to translate this to diesel. You don't need to use migrations for that, you could also just execute these queries on startup manually like you've done before. That said: Migrations are likely a good solution for that, you would put your schema setup into a migration and diesel would take care to run this migration if it was not run previously.

And do I need to have two separate migration folders, one for SQLite and another for Postgre?

Yes you would need to have a separate migration folder for each backend

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by duckfromdiscord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants