From 5011f2d748f83d2b80b8eeda9aae3b186ef1751b Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 14 Jan 2021 15:32:55 -0600 Subject: [PATCH] Set supporter_notes.deleted default to false --- ...3034_set_supporter_note_deleted_default_to_false.rb | 10 ++++++++++ db/structure.sql | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20210114213034_set_supporter_note_deleted_default_to_false.rb diff --git a/db/migrate/20210114213034_set_supporter_note_deleted_default_to_false.rb b/db/migrate/20210114213034_set_supporter_note_deleted_default_to_false.rb new file mode 100644 index 00000000..917aac72 --- /dev/null +++ b/db/migrate/20210114213034_set_supporter_note_deleted_default_to_false.rb @@ -0,0 +1,10 @@ +# 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 SetSupporterNoteDeletedDefaultToFalse < ActiveRecord::Migration[6.1] + def change + change_column_default :supporter_notes, :deleted, from: nil, to: false + change_column_null :supporter_notes, :deleted, false + end +end diff --git a/db/structure.sql b/db/structure.sql index 7ffdec5d..57740003 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2015,7 +2015,7 @@ CREATE TABLE public.supporter_notes ( created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, user_id integer, - deleted boolean + deleted boolean DEFAULT false NOT NULL ); @@ -4156,6 +4156,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210105192021'), ('20210105192022'), ('20210107210143'), -('20210111220133'); +('20210111220133'), +('20210114213034');