-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Hey, I tried using v0.1.4 with ActiveRecord 4.2.10, but the column default is always dumped as YAML, so it appear the default override is not working, if the default is changed.
The gem works, if the default is set when the column is created, but not when trying to change it.
I also tried various combinations of change_column_default and change_column with the same result.
Sample Migration:
class AddIdentifierToProjects < ActiveRecord::Migration
def up
change_table :projects do |t|
t.string :identifier
end
execute "UPDATE projects SET identifier = id"
change_table :projects do |t|
t.change :identifier, :string, null: false, default: {
expr: "currval('projects_id_seq')"
}
end
end
def down
change_table :projects do |t|
t.remove :identifier
end
end
endUnfortunately this migration is impossible to do without changing the column default.