Commit 4c93783287808938873b3ac55cb0f1a98b2f80c6
1 parent
dc0f987c
Exists in
staging
and in
4 other branches
fix migration
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
db/migrate/20150408231524_add_settings_to_comments.rb
| 1 | 1 | class AddSettingsToComments < ActiveRecord::Migration |
| 2 | - def change | |
| 3 | - rename_column :comments, :setting, :settings | |
| 2 | + def self.up | |
| 3 | + add_column :comments, :setting, :text unless column_exists?(:comments, :setting) | |
| 4 | + end | |
| 5 | + | |
| 6 | + def self.down | |
| 7 | + remove_column :comments, :setting | |
| 4 | 8 | end |
| 5 | 9 | end | ... | ... |