Set boolean on CampaignGiftOption to default to false

This commit is contained in:
Eric Schultz 2021-01-15 17:10:06 -06:00 committed by Eric Schultz
parent 0748980bf8
commit 0a1f07e76b
2 changed files with 17 additions and 3 deletions

View file

@ -0,0 +1,13 @@
# frozen_string_literal: true
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class SetBooleanDefaultsOnCampaignGiftOptionToFalse < ActiveRecord::Migration[6.1]
def change
change_column_default :campaign_gift_options, :to_ship, from: nil, to: false
change_column_null :campaign_gift_options, :to_ship, false
change_column_default :campaign_gift_options, :hide_contributions, from: nil, to: false
change_column_null :campaign_gift_options, :hide_contributions, false
end
end

View file

@ -373,9 +373,9 @@ CREATE TABLE public.campaign_gift_options (
amount_dollars character varying(255),
amount_recurring integer,
quantity integer,
to_ship boolean,
to_ship boolean DEFAULT false NOT NULL,
"order" integer,
hide_contributions boolean
hide_contributions boolean DEFAULT false NOT NULL
);
@ -4158,6 +4158,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20210107210143'),
('20210111220133'),
('20210114213034'),
('20210115203009');
('20210115203009'),
('20210115230815');