internetee-registry/db/migrate/20160106101725_version_object_is_jsonb.rb
2016-01-06 15:18:30 +02:00

10 lines
389 B
Ruby

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