From 1d718b92b7eb708ca071a4390947b83bbba28090 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Wed, 19 Jul 2023 19:15:43 +0300 Subject: [PATCH] chore: Fix schema disparities (#7554) - Fixing the schema disparities that crept up during merges - Also, fix the issue with migrate command regenerating the schema for contacts.rb model --- Gemfile.lock | 6 +++--- app/models/contact.rb | 6 +++++- db/schema.rb | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b0e7cff57..b340a1f3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -365,13 +365,13 @@ GEM image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) ruby-vips (>= 2.0.17, < 3) - io-console (0.6.0) - irb (1.7.2) - reline (>= 0.3.6) informers (0.2.0) blingfire (>= 0.1.7) numo-narray onnxruntime (>= 0.5.1) + io-console (0.6.0) + irb (1.7.2) + reline (>= 0.3.6) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) diff --git a/app/models/contact.rb b/app/models/contact.rb index 543100c68..8727ccd78 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -1,3 +1,5 @@ +# rubocop:disable Layout/LineLength + # == Schema Information # # Table name: contacts @@ -19,12 +21,14 @@ # index_contacts_on_account_id (account_id) # index_contacts_on_lower_email_account_id (lower((email)::text), account_id) # index_contacts_on_name_email_phone_number_identifier (name,email,phone_number,identifier) USING gin -# index_contacts_on_nonempty_fields (account_id,email,phone_number,identifier) WHERE (((email)::text <> ''::text) OR ((phone_number)::text <> ''::text) OR ((identifier)::text <> ''::text)) # rubocop:disable Layout/LineLength +# index_contacts_on_nonempty_fields (account_id,email,phone_number,identifier) WHERE (((email)::text <> ''::text) OR ((phone_number)::text <> ''::text) OR ((identifier)::text <> ''::text)) # index_contacts_on_phone_number_and_account_id (phone_number,account_id) # uniq_email_per_account_contact (email,account_id) UNIQUE # uniq_identifier_per_account_contact (identifier,account_id) UNIQUE # +# rubocop:enable Layout/LineLength + class Contact < ApplicationRecord include Avatarable include AvailabilityStatusable diff --git a/db/schema.rb b/db/schema.rb index ab3986e15..373dfbec1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -585,8 +585,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_07_14_054138) do t.jsonb "auto_assignment_config", default: {} t.boolean "lock_to_single_conversation", default: false, null: false t.bigint "portal_id" - t.string "business_name" t.integer "sender_name_type", default: 0, null: false + t.string "business_name" t.index ["account_id"], name: "index_inboxes_on_account_id" t.index ["channel_id", "channel_type"], name: "index_inboxes_on_channel_id_and_channel_type" t.index ["portal_id"], name: "index_inboxes_on_portal_id"