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

Fix PostgreSQL range tests on fresh DB #13393

Merged
merged 1 commit into from
Dec 19, 2013

Conversation

matthewd
Copy link
Member

The changes in c4044b2 meant the tests would error on a fresh DB.

Correcting the name of the table we're creating is self-explanatory.

But we must also move away from the low IDs, because we're not touching the freshly-created primary key sequence; when the time comes, @new_range will be assigned an ID of 1.


I assume this is currently passing for anyone whose activerecord_unittest DB pre-dates c4044b2... if true, I imagine this change is likely to fail (well, skip) for those people.

That being the case, I see three options:

  1. Introduce a DROP TABLE IF EXISTS before the create_table in setup (ugly)
  2. Move the table creation back to postgresql_specific_schema.rb with all the rest (it was presumably moved for a reason)
  3. Declare everyone needs to drop & recreate their testing DB (ugh)

/cc @senny

The changes in c4044b2 meant the tests would error on a fresh DB.
@carlosantoniodasilva
Copy link
Member

Just tried your patch on a fresh database, indeed we have this issue and your patch fixes it, thank you for your contribution.

carlosantoniodasilva added a commit that referenced this pull request Dec 19, 2013
Fix PostgreSQL range tests on fresh DB

Correcting the name of the table we're creating is self-explanatory.

But we must also move away from the low IDs, because we're not touching the freshly-created primary key sequence; when the time comes, @new_range will be assigned an ID of 1.
@carlosantoniodasilva carlosantoniodasilva merged commit 5b0fc1a into rails:master Dec 19, 2013
@matthewd matthewd deleted the fix_pg_range_tests branch December 19, 2013 10:55
@senny
Copy link
Member

senny commented Dec 19, 2013

@matthewd thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants