Corrected migration, to populate the new tags table

This commit is contained in:
echarp 2016-12-17 17:24:05 +01:00
parent 0861b5e37f
commit f1a286d8cc
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ class PopulateTags < ActiveRecord::Migration
def self.up def self.up
execute('SELECT id, tags FROM events;').each do |result| execute('SELECT id, tags FROM events;').each do |result|
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]
event.save event.save
end end

View File

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161210154558) do ActiveRecord::Schema.define(version: 20161210105333) do
create_table "active_admin_comments", force: :cascade do |t| create_table "active_admin_comments", force: :cascade do |t|
t.string "namespace", limit: 255 t.string "namespace", limit: 255
@ -70,7 +70,7 @@ ActiveRecord::Schema.define(version: 20161210154558) do
t.string "contact", limit: 255, default: "", null: false t.string "contact", limit: 255, default: "", null: false
t.string "submitter", limit: 255, default: "", null: false t.string "submitter", limit: 255, default: "", null: false
t.integer "moderated", limit: 4, default: 0, null: false t.integer "moderated", limit: 4, default: 0, null: false
t.text "tags", limit: 255, default: "" t.text "tags", limit: 255, default: "", null: false
t.string "secret", limit: 255, default: "", null: false t.string "secret", limit: 255, default: "", null: false
t.datetime "decision_time" t.datetime "decision_time"
t.datetime "submission_time" t.datetime "submission_time"
@ -124,7 +124,7 @@ ActiveRecord::Schema.define(version: 20161210154558) do
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.text "tag" t.text "tag"
t.text "tags", default: "" t.text "tags", default: "", null: false
t.text "diaspora" t.text "diaspora"
t.text "object_changes" t.text "object_changes"
t.text "place_name" t.text "place_name"