janko / rodauth-rails

Rails integration for Rodauth authentication framework
https://github.com/jeremyevans/rodauth
MIT License
593 stars 40 forks source link

Index causing conflict: audit_at_idx #305

Closed thedumbtechguy closed 3 months ago

thedumbtechguy commented 3 months ago

I found a bug in these 2 generator templates.

Since the index name is not templated, it causes a conflict if multiple accounts enable the audit logging feature.

https://github.com/janko/rodauth-rails/blob/9d2daf934e00ead48a144fa9557cbdced1fe35f2/lib/generators/rodauth/migration/active_record/audit_logging.erb#L15

https://github.com/janko/rodauth-rails/blob/9d2daf934e00ead48a144fa9557cbdced1fe35f2/test/rails_app/db/migrate/20200411171322_create_rodauth.rb#L61

janko commented 3 months ago

Thanks for the report. It doesn't appear that Rodauth is using those index names, so I think we can just let the default index name kick in. Would you mind sending a PR?

thedumbtechguy commented 3 months ago

Sure thing. Just remove the name right?

janko commented 3 months ago

Yeah, I think that should be fine 👍