Rails migrate date to string?
I have a field in my db table which is a date rather than string, how do I make a migration to convert it to a string?
class CreateKases < ActiveR开发者_运维知识库ecord::Migration
def self.up
create_table :kases do |t|
t.date :dateclosed
Is it even possible?
Thanks,
Danny
You can change a column by using change_column.
def self.up
change_column :kases, :dateclosed, :string
end
Hope that helps.
精彩评论