I insert a column in my sqlite with a wrong type "stringimage".
How can I change the column type to string?
I tried change_column :users, :uid, :string
and
def up
change_table :users do |t|
t.change :uid, :stringimage
end
end
def down
change_table :users do |t|
t.change :uid, :string
end
end
but it doesn't works. I tried many things but none of it works, maybe because I'm using rails 5.
You Need to write following two definitions into your migration :
def up
change_column :my_table, :my_column, :string
end
def down
change_column :my_table, :my_column, :stringimage
end