New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from SQLite to PostgreSQL #716
Comments
On Tue, Mar 01, 2016 at 02:20:06PM -0800, Piotr Banaszkiewicz wrote:
Do we need any of PostgreSQL-specific features? I expect we can
This is going to be pretty similar to SQLite, you just have to adjust |
Hi @wking,
If we were using PostgreSQL for development too, then it would be safer to use PostgreSQL-specific features – and I know a few places we could use them (e.g. ArrayField for Tags) Anyway, this is just something I was thinking for a while. It may take some time before we actually go this way. |
On Tue, Mar 01, 2016 at 10:36:04PM -0800, Piotr Banaszkiewicz wrote:
I'm not sure that benefit is worth breaking SQLite for dev/testing. |
We can agree that if production runs PostgreSQL, then testing must be done with it. Travis provides docs about integrating with the db server and it looks relatively painless. The next question is whether local development must use postgres or keep using sqlite. I think that depends on if you're testing locally. Obviously if a PR comes in that was developed against sqlite and CI tests don't pass, it won't be merged until they do. But it could leave a sour taste in the mouth of the submitter; if the docs say it doesn't matter if you use postgres or sqlite in development but a PR isn't accepted even though tests passed locally, that seems like a contradiction to me. FWIW I've found PostgreSQL to be much easier to install than python. On OS X at least, there's Postgres.app and the homebrew formula (which if you go down that route, |
On Wed, Mar 02, 2016 at 05:43:48AM -0800, Scott Burns wrote:
I think that would be nice to have, but it's not a hard requirement |
It's less about doing SQLite-specific stuff and more about thinking operations exercised in the test suite are valid when in production PostgreSQL doesn't (e.g. SQLite doesn't enforce referential integrity by default). Alas, I too am not the maintainer or sys-admin so take this soapbox with a grain of salt :) |
On Wed, Mar 02, 2016 at 01:55:14PM -0800, Scott Burns wrote:
I'm all for turning that on, whether in SQLite 1 or by switching to |
Hi both, I'm really glad for your insights – that's a discussion I wanted to have when I created this issue. I think we'll start with "SQLite for dev, PostgreSQL for prod" approach first since that seems to be most popular option. Thanks, |
It appears like Fortunately amy doesn't have a complicated settings.py file :) |
@sburns I was thinking about https://github.com/kennethreitz/dj-database-url too, but these are "implementation details"… |
Before migrating we need to fix #1044. |
@pbanaszkiewicz In an upcoming cycle, could we outline:
Leaving this as a reminder for now to revisit soon. |
@fmichonneau @maneesha Took us almost 5 years :) |
Why? Because AMY is going to serve a higher load and SQLite isn't meant for that.
Why PostgreSQL? Because it has a really nice support in Django.
Challenges:
settings.py
that works with both servers (use https://github.com/kennethreitz/dj-database-url ?).The text was updated successfully, but these errors were encountered: