Skip to content

Instantly share code, notes, and snippets.

@plmok61
Created June 23, 2015 03:03
Show Gist options
  • Save plmok61/720cd7e0016d25052051 to your computer and use it in GitHub Desktop.
Save plmok61/720cd7e0016d25052051 to your computer and use it in GitHub Desktop.
Syntax for changing columns
class ChangeDateTimeDefault < ActiveRecord::Migration
def change
change_column :teams, :wk1_time, :default => DateTime.now
change_column :teams, :wk2_time, :default => DateTime.now
change_column :teams, :wk3_time, :default => DateTime.now
change_column :teams, :wk4_time, :default => DateTime.now
change_column :teams, :wk5_time, :default => DateTime.now
change_column :teams, :wk6_time, :default => DateTime.now
change_column :teams, :wk7_time, :default => DateTime.now
change_column :teams, :wk8_time, :default => DateTime.now
change_column :teams, :wk9_time, :default => DateTime.now
change_column :teams, :wk10_time, :default => DateTime.now
change_column :teams, :wk11_time, :default => DateTime.now
change_column :teams, :wk12_time, :default => DateTime.now
change_column :teams, :wk13_time, :default => DateTime.now
change_column :teams, :wk14_time, :default => DateTime.now
change_column :teams, :wk15_time, :default => DateTime.now
change_column :teams, :wk16_time, :default => DateTime.now
change_column :teams, :wk17_time, :default => DateTime.now
end
end
@plmok61
Copy link
Author

plmok61 commented Jun 23, 2015

Any idea why this is failing when I dry to migrate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment