Convert pending_json field to jsonb so it can be compared without typecasting

This commit is contained in:
Maciej Szlosarczyk 2018-08-24 12:53:29 +03:00
parent b7dfc19b9f
commit 1d53e7bb5b
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,9 @@
class ChangeDomainPendingJsonToJsonb < ActiveRecord::Migration
def up
change_column :domains, :pending_json, 'jsonb USING CAST(pending_json AS jsonb)'
end
def down
change_column :domains, :pending_json, 'json USING CAST(pending_json AS json)'
end
end

View file

@ -904,7 +904,7 @@ CREATE TABLE public.domains (
delete_at timestamp without time zone,
registrant_verification_asked_at timestamp without time zone,
registrant_verification_token character varying,
pending_json json,
pending_json jsonb,
force_delete_at timestamp without time zone,
statuses character varying[],
reserved boolean DEFAULT false,
@ -4760,3 +4760,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180613045614');
INSERT INTO schema_migrations (version) VALUES ('20180808064402');
INSERT INTO schema_migrations (version) VALUES ('20180824092855');