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

Unable to migrate an STI table with 0.18.2 #82

Closed
hjdivad opened this issue Oct 15, 2014 · 7 comments · Fixed by #83
Closed

Unable to migrate an STI table with 0.18.2 #82

hjdivad opened this issue Oct 15, 2014 · 7 comments · Fixed by #83

Comments

@hjdivad
Copy link

hjdivad commented Oct 15, 2014

$ $(which crypt_keeper) --old-key 'KEY' --new-key 'NEW_KEY' --salt 'SALT' --table-name 'users' --columns 'ssn' --old-encryptor aes
`rescue in find_sti_class': The single-table inheritance mechanism failed to locate the subclass: 'Admin'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite MigrateData.inheritance_column to use another column for that information. (ActiveRecord::SubclassNotFound)
@itspriddle
Copy link
Collaborator

Hey @hjdivad, can you give the bugfix/sti-models branch a try?

@hjdivad
Copy link
Author

hjdivad commented Oct 15, 2014

@itspriddle that branch almost works.

I have some records where the encrypted field is empty which results in the error:

/Users/davidjh/.rvm/gems/ruby-2.1.1g/gems/aes-0.5.0/lib/aes/aes.rb:119:in `update': data must not be empty (ArgumentError)

But if I clear out all of those records the migration works.

@itspriddle
Copy link
Collaborator

@hjdivad that's actually a separate issue, but I think I've figured out a work around. Can you pull the changes from bugfix/sti-models and try once more?

@jmazzi
Copy link
Owner

jmazzi commented Oct 20, 2014

@hjdivad have you had a chance to try out this fix?

@hjdivad
Copy link
Author

hjdivad commented Oct 20, 2014

@jmazzi @itspriddle just re-ran the migration and it works great! Thanks ^_^

@jmazzi
Copy link
Owner

jmazzi commented Oct 20, 2014

@hjdivad this has been released as 0.18.4

@hjdivad
Copy link
Author

hjdivad commented Oct 20, 2014

@jmazzi awesome thanks ^_^

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 a pull request may close this issue.

3 participants