-
Notifications
You must be signed in to change notification settings - Fork 30
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
Full support for AR5 #14
Conversation
Tests are green for SQLite now
1 similar comment
@boazy you're a hero! I agree it makes sense to make an AR5 branch -- or even better, make an AR4 branch for any updates to old code, and use master for AR5. Any reason this couldn't be a minor version bump (1.1.0) rather than major (2.0.0)? Are there any backwards-incompatible changes? If there are no incompatible changes, I'd go with 1.1.0 and let bundler resolve the dependencies to choose 1.0.x for AR 4.2 and >= 1.1.0 for AR 5.x My quick tests show that schema_plus_foreign_keys and schema_plus_indexes fail under AR 5.0 even with your updated schema_plus_core, though that's probably due to problems directly in those gems rather than here in schema_plus_core. Since the tests pass, I'm tempted to simply release your version (with a note in the README indicating that AR 4.2 support ended with 1.0.x), then go on to look into the other gems in the family. If it turns out there are corner cases not covered by the tests, we could then go back and cut a patch release. More conservative would be to cut a prerelease (1.1.0.pre or 2.0.0.pre) but that just seems like it'd add complications for no great benefit. Your thoughts? BTW this contribution completely qualifies you to be a member of the SchemaPlus github team so you can work without requiring me to be in the loop. If you're interested let me know. Thanks! |
Thanks @ronen! It seems most gems depending on schema_plus_core specify "~> 1.0", and this version definitely breaks backward compatibility by pushing a dependency on AR5 when auto-updating. I think the GemSpec still accepts AR4.2, but the gem would fail with that version now. I could try to detect AR4.2 and change the behavior accordingly, but that would make the change more complicated than I'm comfortable with. In the meantime, I've managed to get schema_plus_foreign_keys to pass the tests (at least on my machine) with very little modifications - essentially all the failures stem from expecting deprecation warnings, but not preparing for the new deprecation warning raised by using I'm now trying to fix schema_associations, and it gets a lot of failures I don't yet understand. I'm pretty sure most of the gems dependent on schema_plus_core are going to fail initially with AR5, if only due to the new deprecation warnings, so they will all need to be bumped. :( I'd be happy to have a proper release anyway, since it will make fixing the rest of the gems down the chain easier. :) Thanks for adding me to the team! |
...and even more so (I finally had time to look through it) it changes the middleware API that the gem exports, renaming Could you update the README to reflect that change, as well as the additional parameter to Query::Exec, and any other API changes? Then I'll quick as I can merge this and cut the 2.0 release. |
I'm pretty sure SchemaMonkey::Middleware::Schema::Tables would be back in the future, but it would be back with different semantics, which is why the deprecation warning is raised at the first place. I also hesitated changing that, but in the end you can't protect the users from the change AR is planning to introduce (apparently starting with Rails 5.1). And, I'll definitely update the readme. I should have done that earlier, but I just wanted to see whether change is okay. Thanks for the support! |
See: SchemaPlus/schema_plus_core#14 Signed-off-by: Alex Coles <[email protected]>
See: SchemaPlus/schema_plus_core#14 Signed-off-by: Alex Coles <[email protected]>
Fixes #9
I've managed to get all tests passing with this PR, but in the price of removing AR4.2 support.
Due to the differences between AR4.2 and AR5, supporting both of them simultaneously is going to complicate the code and I'm not sure I'm up to that task.
It's probably best to just start a new branch for AR5, since it's it's different enough.
All the tests are green now, but there are probably some corner cases left which are not covered and could surface later with dependencies on schema_plus_core.
I've removed monkey patching of
Dumper::Indexes
(since indexes are now created inline increate_table
), but it seems like materialized views are not using it, although It seems like schema_plus_views doesn't support them anyway, so I left that out for now.