Skip to content
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

Add support for PostgreSQL (second attempt) #1203

Open
wants to merge 11 commits into
base: develop
from

Conversation

Projects
None yet
2 participants
@chrismedrela
Copy link
Collaborator

commented Jul 10, 2017

This is a continuation of #1168.

chrismedrela added some commits Mar 28, 2017

Fix db bug in TestBase._setUpOrganization
Organization.country must be a two-letter shortcut (like AZ for Azerbaijan). Maximum length of CharFields is not enforced on SQLite3, therefore this database accepts longer (=invalid) country names. However, it's results in an error on PostgreSQL.
Fix db bug in test_getting_events
TestWebsiteUpdatesCommand.test_getting_events assumes that records returned by Event.objects.all() are sorted by id. This is true on SQLite3, but not on PostgreSQL, which resulted this test failing when using PostgreSQL.
Fix db bug in migration no 0097
This migration creates languages with name that exceeds maximum length. This doesn't result in an error on SQLite3, because this db doesn't enforce maximum length. However, it doesn't work on PostgreSQL.
Fix db bug in migration no 0098
This migration works on SQLite3, but it didn't work on PostgreSQL.
Fix db bug in instructors_activity tool
This command should return instructors more or less in the same order. Tests assume that they are sorted by id. This is default on SQLite3, but not on PostgreSQL, resulting in some tests failing.
Fix db bug in instructors_by_time_queryset
Using .exclude(event__tags=tags) works on SQLite3, but not on PostgreSQL, where it results in an error that a subquery used as an expression returned more than one value. We need to use `event__tags__in` instead of `event__tags`.
Fix db bug in ExportInstructorLocationsView
For each airport that this view returns, the list of instructors should be ordered. SQLite3 sorts by id by default, but it's different on PostgreSQL, resulting in some tests failing on the latter db.
Use db-agnostic DATABASE_URL
instead of AMY_DB_FILENAME that forces as to use SQLite3.

This commit uses dj_database_url library that extracts all database configuration from a single DATABASE_URL env var. This is a common way of configuring db that is used i.e. on Heroku.
Configure Travis CI to support PostgreSQL
Tests are now run on both SQLite3 and PostgreSQL.

@chrismedrela chrismedrela added this to the v1.11 milestone Jul 10, 2017

@chrismedrela chrismedrela self-assigned this Jul 10, 2017

@chrismedrela chrismedrela modified the milestones: v1.12, v1.11 Jul 10, 2017

pbanaszkiewicz added a commit to pbanaszkiewicz/amy that referenced this pull request Jun 2, 2018

Fix carpentries#1165 -- correct truncated language names
This commit was cherry-picked from @chrismedrela carpentries#1203 PR.

This commit fixes carpentries#1165.

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v1.12, v2.0 Jun 24, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.0, v2.1 Jul 30, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.1, v2.2 Sep 4, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.2, v2.3 Nov 1, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.3, v2.4 Dec 1, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.4, v2.5 Dec 29, 2018

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.5, v2.6 Jan 30, 2019

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.6, v2.7 Feb 28, 2019

@pbanaszkiewicz pbanaszkiewicz modified the milestones: v2.7, v2.8 Mar 29, 2019

@pbanaszkiewicz pbanaszkiewicz removed this from the v2.8 milestone Jun 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.