Upgrade to rails 4.2 index disapeared

7 views
Skip to first unread message

João Bordalo

unread,
Oct 16, 2017, 1:48:22 PM10/16/17
to Ruby on Rails: Talk
Hi there,

I have an app that needs to be upgraded from rails 3.2 to 4.2.

Along the run, this error appeared:

undefined method `request_uuid' for #<Audited::Adapters::ActiveRecord::Audit:0x007ff347b3ead8> Did you mean? reset_id!


To resolve this issue, I made some research and found that it was required to create a migration in my db, so I did the following commands:

$rails generate audited:upgrade
$bundle exec rake db:migrate

After this, the application was working, however I noticed that my db/schema.rb file changed. It appeared a lot different, such as, some columns in my tables have 'limit: 255' for string type columns and, the worst part, it removed all my 'add_index', like this one:

   - add_index "activities_contacts", ["activity_id", "contact_id"], :name => "index_activities_contacts_on_activity_id_and_contact_id"

Just for the record, with this migration, it also added the "request_uuid" column, as expected.

The question is: Do you know what happened? Is this a normal thing to happen?


Thank you for your help,
João Bordalo
Reply all
Reply to author
Forward
0 new messages