Corrected migration, to populate the new tags table

This commit is contained in:
echarp 2016-12-17 17:22:36 +01:00
parent 5b3228dae8
commit 0861b5e37f
1 changed files with 4 additions and 6 deletions

View File

@ -5,16 +5,14 @@ class PopulateTags < ActiveRecord::Migration
event = Event.find_by id: result[0]
event.tag_list = result[1] + ' helo world'
event.save
say event.id
say event.tag_list
end
change_column :events, :tags, :text, null: true
change_column :orgas, :tags, :text, null: true
change_column_null :events, :tags, true
change_column_null :orgas, :tags, true
end
def self.down
change_column :events, :tags, :text, null: false
change_column :orgas, :tags, :text, null: false
change_column_null :events, :tags, false
change_column_null :orgas, :tags, false
end
end