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

View File

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