From 0748980bf8858d5d91b702a735b291d075075b9e Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Fri, 15 Jan 2021 14:34:57 -0600 Subject: [PATCH] Correct SupporterNote Activity.attachment_type typo --- ...0115203009_fix_typo_in_activity_attachment_type.rb | 11 +++++++++++ db/structure.sql | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210115203009_fix_typo_in_activity_attachment_type.rb diff --git a/db/migrate/20210115203009_fix_typo_in_activity_attachment_type.rb b/db/migrate/20210115203009_fix_typo_in_activity_attachment_type.rb new file mode 100644 index 00000000..259c1972 --- /dev/null +++ b/db/migrate/20210115203009_fix_typo_in_activity_attachment_type.rb @@ -0,0 +1,11 @@ +# 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 + +# The attachment_type for SupporterNote activities is wrong. This code fixes that +class FixTypoInActivityAttachmentType < ActiveRecord::Migration[6.1] + def up + Activity.connection.execute("UPDATE activities SET attachment_type = 'SupporterNote' WHERE (kind = 'SupporterNote' AND attachment_type != 'SupporterNote')") + end +end diff --git a/db/structure.sql b/db/structure.sql index 57740003..f294819d 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -4157,6 +4157,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20210105192022'), ('20210107210143'), ('20210111220133'), -('20210114213034'); +('20210114213034'), +('20210115203009');