From 1d53e7bb5b4a48fb843b59f040fb1271442d0394 Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Fri, 24 Aug 2018 12:53:29 +0300 Subject: [PATCH] Convert pending_json field to jsonb so it can be compared without typecasting --- ...20180824092855_change_domain_pending_json_to_jsonb.rb | 9 +++++++++ db/structure.sql | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20180824092855_change_domain_pending_json_to_jsonb.rb diff --git a/db/migrate/20180824092855_change_domain_pending_json_to_jsonb.rb b/db/migrate/20180824092855_change_domain_pending_json_to_jsonb.rb new file mode 100644 index 000000000..10639527a --- /dev/null +++ b/db/migrate/20180824092855_change_domain_pending_json_to_jsonb.rb @@ -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 diff --git a/db/structure.sql b/db/structure.sql index c4b0b9d7a..243a6f900 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -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'); +