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

Unsupported adapter when running migration (2.11.1) #1650

Closed
philipguedes opened this issue Aug 15, 2023 · 6 comments
Closed

Unsupported adapter when running migration (2.11.1) #1650

philipguedes opened this issue Aug 15, 2023 · 6 comments

Comments

@philipguedes
Copy link

Hi!

I'm trying to configure rails_event_store 2.11.1 in an existing rails project using the Advanced setup.

When I try to setup the data model using

bin/rails generate rails_event_store_active_record:migration

I'm getting the one-liner error

Unsupported adapter

I downgraded to 2.9.1, used the same command and it worked like a charm.

@lukaszreszke
Copy link
Contributor

Hi @philipguedes,

What database are you using?

@philipguedes
Copy link
Author

Hey @lukaszreszke thanks for replying.

Hi @philipguedes,

What database are you using?

I'm using postgres 15+

If it comes in handy, I created a repo to reproduce this problem

@lukaszreszke
Copy link
Contributor

Thanks for the repo with repro reproduction @philipguedes. Indeed it helped a lot.

I found the root cause of the issue.

In RubyEventStore::ActiveRecord we define supported adapters:
https://github.com/RailsEventStore/rails_event_store/blob/master/ruby_event_store-active_record/lib/ruby_event_store/active_record/generators/verify_adapter.rb#L8

Supported adapters are generally:
SUPPORTED_ADAPTERS = %w[mysql2 postgresql sqlite].freeze

Both for RES 2.9.1 and RES 2.11.1 the adapter introduces itself as postgis:

irb(main):001:0>         ::ActiveRecord::Base.connection.adapter_name.downcase
=> "postgis"

In 2.10 the code with the VerifyDataType was released, so now it blocks the migration as postgis is not supported.

I'll notify you when the fix is rolled out. Thanks for reporting this issue.

@mostlyobvious
Copy link
Member

So it's an additional gem that provides postgresql-like adapter, that introduces itself as postgis:
https://github.com/rgeo/activerecord-postgis-adapter/blob/master/lib/active_record/connection_adapters/postgis_adapter.rb#L26-L29

@fidel fidel mentioned this issue Aug 25, 2023
4 tasks
@fidel
Copy link
Contributor

fidel commented Aug 28, 2023

Hey @philipguedes!

The issue you've experienced is resolved on master with commit: b2d7396

We should release it officially soon, but you can start using it right away with this entry in your Gemfile:

gem "rails_event_store", github: "RailsEventStore/rails_event_store", ref: "b2d7396"

Thanks for the detailed report and happy coding!

@fidel fidel closed this as completed Aug 28, 2023
@pjurewicz
Copy link
Contributor

Hey @philipguedes,
this issue is fixed in rails_event_store v. 2.12.0.
thank you for your engagement.

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

No branches or pull requests

5 participants