From 659cb7f4e67ee51545b6ea0ce5b20e030e881591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 21 Sep 2020 13:34:34 +0300 Subject: [PATCH] Combine migrations, remove json objects from bounced mails --- ...0200916125326_create_bounced_mail_addresses.rb | 9 ++++++--- ..._add_recipient_json_to_bounced_mail_address.rb | 5 ----- ...emove_incidents_from_bounced_mail_addresses.rb | 9 --------- db/structure.sql | 15 ++++++++------- 4 files changed, 14 insertions(+), 24 deletions(-) delete mode 100644 db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb delete mode 100644 db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb diff --git a/db/migrate/20200916125326_create_bounced_mail_addresses.rb b/db/migrate/20200916125326_create_bounced_mail_addresses.rb index c6600afea..e1744cc9a 100644 --- a/db/migrate/20200916125326_create_bounced_mail_addresses.rb +++ b/db/migrate/20200916125326_create_bounced_mail_addresses.rb @@ -2,9 +2,12 @@ class CreateBouncedMailAddresses < ActiveRecord::Migration[6.0] def change create_table :bounced_mail_addresses do |t| t.string :email, null: false - t.string :bounce_reason, null: false - t.integer :incidents, null: false, default: 1 - t.jsonb :response_json + t.string :message_id, null: false + t.string :bounce_type, null: false + t.string :bounce_subtype, null: false + t.string :action, null: false + t.string :status, null: false + t.string :diagnostic, null: true t.timestamps end diff --git a/db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb b/db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb deleted file mode 100644 index bad3d846e..000000000 --- a/db/migrate/20200917104213_add_recipient_json_to_bounced_mail_address.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddRecipientJsonToBouncedMailAddress < ActiveRecord::Migration[6.0] - def change - add_column :bounced_mail_addresses, :recipient_json, :jsonb, null: false - end -end diff --git a/db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb b/db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb deleted file mode 100644 index 0704795df..000000000 --- a/db/migrate/20200921084356_remove_incidents_from_bounced_mail_addresses.rb +++ /dev/null @@ -1,9 +0,0 @@ -class RemoveIncidentsFromBouncedMailAddresses < ActiveRecord::Migration[6.0] - def up - remove_column :bounced_mail_addresses, :incidents - end - - def down - add_column :bounced_mail_addresses, :incidents, :integer, null: false, default: 1 - end -end diff --git a/db/structure.sql b/db/structure.sql index 74e784408..e064d968f 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -482,11 +482,14 @@ ALTER SEQUENCE public.blocked_domains_id_seq OWNED BY public.blocked_domains.id; CREATE TABLE public.bounced_mail_addresses ( id bigint NOT NULL, email character varying NOT NULL, - bounce_reason character varying NOT NULL, - response_json jsonb, + message_id character varying NOT NULL, + bounce_type character varying NOT NULL, + bounce_subtype character varying NOT NULL, + action character varying NOT NULL, + status character varying NOT NULL, + diagnostic character varying, created_at timestamp(6) without time zone NOT NULL, - updated_at timestamp(6) without time zone NOT NULL, - recipient_json jsonb NOT NULL + updated_at timestamp(6) without time zone NOT NULL ); @@ -4956,8 +4959,6 @@ INSERT INTO "schema_migrations" (version) VALUES ('20200908131554'), ('20200910085157'), ('20200910102028'), -('20200916125326'), -('20200917104213'), -('20200921084356'); +('20200916125326');