Story#108602614 - optimize contacts history import

This commit is contained in:
Vladimir Krylov 2016-01-06 15:18:30 +02:00
parent b75b35f554
commit 1fb0259806
6 changed files with 35 additions and 14 deletions

View file

@ -0,0 +1,10 @@
class VersionObjectIsJsonb < ActiveRecord::Migration
def up
change_column :log_contacts, :object, :jsonb, using: "object::jsonb"
execute %q(CREATE INDEX "log_contacts_object_legacy_id" ON "log_contacts"(cast("object"->>'legacy_id' as int)))
add_index :registrars, :legacy_id
end
def down
change_column :log_contacts, :object, :json, using: "object::json"
end
end