Closed sdc50 closed 1 year ago
@sdc50 can you rebase this now that the other one is merged?
Remaining work for this PR:
see: https://github.com/tethysplatform/tethys/issues/925#issuecomment-1450384795
Add data migration command/instructions to switch from one type of DB to another
I'm not sure about this one. I played around with the Django dumpdata
and loaddata
commands. It takes a little fingagling, and only worked for simple cases. I may provide some instructions to repeat what I did with the caveat that it likely won't work smoothly.
@swainn I think this is ready to go. As for the production documentation I think that it is out of scope to write a detailed guide for setting up other types of databases, and if we ever did I would want to throughly test them in a production environment first. What I did include is an explanation that other database backends are possible and referred to the Django Database docs for more details.
Also, it looks like the most recent version of python-social-auth
was breaking our tests. As far as I can tell it just dropped support for a very outdated way of using middleware, but our tests were still calling it with the old style (not passing in a get_request
argument).
Also, it looks like the most recent version of
python-social-auth
was breaking our tests. As far as I can tell it just dropped support for a very outdated way of using middleware, but our tests were still calling it with the old style (not passing in aget_request
argument).
Is it only our tests that are using the old way? Is the code up-to-date?
Do we need to add sqlite3 to the environment.yml? Are we planning to take out the postgresql dependencies and add instructions for installing them when you want to use postgresql?
sqlite3 is native to Python so no dependencies needed. I wasn't planning to remove the PostgreSQL dependencies. I think they are still handy to have available to test production environments.
Is it only our tests that are using the old way? Is the code up-to-date?
The TethysSocialAuthExceptionMiddleware
class is never actually instantiated in our code. It's added as a middleware, so I think it's only instantiated by Django.
Changes the default database configuration in settings to use SQLite instead of Postgres.
Provides backwards compatibility code to detect if a default Postgres database was already configured to preserves the
postgresql
engine in that case.