Different migrations for different DB types? #4403
-
I'm writing a program in Rust that I want to be able to use either SQLite or PostgreSQL. Right now, it only works with SQLite and it runs a "schema" every startup that has a bunch of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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.
Yes you would need to have a separate migration folder for each backend |
Beta Was this translation helpful? Give feedback.
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.
Yes you would need to have a separate migration folder for each backend