diff --git a/db/migrate/20210115230815_set_boolean_defaults_on_campaign_gift_option_to_false.rb b/db/migrate/20210115230815_set_boolean_defaults_on_campaign_gift_option_to_false.rb new file mode 100644 index 00000000..4e681eb4 --- /dev/null +++ b/db/migrate/20210115230815_set_boolean_defaults_on_campaign_gift_option_to_false.rb @@ -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 diff --git a/db/structure.sql b/db/structure.sql index f294819d..6e424758 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -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');