I have created a new migration in order to add a new Paperclip attachment to a current model already owning a Paperclip attachment.
Though made an error and defined the data type as attachment
instead of add_attachment
:
class AddDetailsToProfilepics < ActiveRecord::Migration[5.0]
def change
add_column :profilepics, :finalimage, :attachment
end
end
Then i noticed no extra column was created by paperclip (*_file_name *_content_type) and realise I made a mistake.
Though now no Rollback is possible as it triggers an error. I created a new migration (to remove this column with wrong data type) and got a similar error:
undefined method 'to_sym' for nil:NilClass
When looking at shema.rb the data type is not entered:
...
t.integer "y"
t.integer "width"
t.integer "height"
t. "finalimage"
t.index ["professionnel_id"], name: "index_profilepics_on_professionnel_id"
I tried to change it to string and re-run the new "remove_column" migration but same error.