views:

11

answers:

1

Hi Everyone,

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 < ActiveRecord::Migration
  def self.up
    create_table :kases do |t|
    t.date :dateclosed

Is it even possible?

Thanks,

Danny

+2  A: 

You can change a column by using change_column.

def self.up
    change_column :kases, :dateclosed, :string
end

Hope that helps.

mat3001
Great, thats a big help. thanks!
dannymcc