dani-garcia / vaultwarden

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs
GNU Affero General Public License v3.0
36.78k stars 1.79k forks source link

about migration && schema.rs path #840

Closed insub closed 4 years ago

insub commented 4 years ago

Subject of the issue

I use sqlite db on development and mysql db on production. If i run diesel migration generate <name> (like bitwarden_rs's wiki) the migration file generate and put in "migrations/" , but not "migrations/sqlite", so i have to run diesel migration generate <name> --migration-dir migrations/sqlite

The same happens when you execute build, the schema.rs generate and put in "src/db/", not "src/db/schemas/sqlite"

Your environment

MacOS 10.15.3

Steps to reproduce

diesel migration generate <name> cargo run --features sqlite

Expected behaviour

schema.rs put in "src/db/schemas/sqlite"

Actual behaviour

schema.rs put in "src/db"

dani-garcia commented 4 years ago

Yeah, it's one of the quirks of trying to work with a SQL library that isn't very focused in supporting multiple databases simultaneously, you'll have to handle the moving files to their respective folders and also generating those different schemas and migrations per database. I don't think there's much we can do about it