Hi all
I have a Phoenix application that has it’s own Postgres database and also needs to communicate to a read only database on a different machine to get catalog type of data. This works fine and I’ve setup my application with two Repo’s and can retrieve data.
The problem I’m running into is with running
mix test
this is attempting to use a test database that doesn’t exist (and can’t really as the read only database is a huge legacy system of record for multiple applications). I know with ecto.migrate I can pass a -r flag to say which Repo to use but when running tests that flag doesn’t seem to exist.
Can anyone point me to some documentation on this?
BTW even the -r flag is a bit wonky in my opinion. I would think having a flag in the configuration to say the database is read only so don’t try and use it for generators, migrations or tests would be a much cleaner integration and potentially avoid risk of accidentally running mix ecto.reset and having it cascade inadvertently to a database that wasn’t meant for dropping (I realize you could have a different db user that’s read only but for development it’s not always easy to get an operations team member to do things like add users to a database).
Thanks for any help.