chore: Upgrade to Rails 7 (#6719)

fixes: #6736
This commit is contained in:
Sojan Jose
2023-05-06 10:44:52 +05:30
committed by GitHub
parent 59433d9d3c
commit 022383d942
53 changed files with 1696 additions and 682 deletions

View File

@@ -0,0 +1,8 @@
# This migration comes from active_storage (originally 20211119233751)
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
def change
return unless table_exists?(:active_storage_blobs)
change_column_null(:active_storage_blobs, :checksum, true)
end
end

View File

@@ -10,8 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2023_04_26_130150) do
ActiveRecord::Schema[7.0].define(version: 2023_04_26_130150) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -22,8 +21,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "owner_type"
t.bigint "owner_id"
t.string "token"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["owner_type", "owner_id"], name: "index_access_tokens_on_owner_type_and_owner_id"
t.index ["token"], name: "index_access_tokens_on_token", unique: true
end
@@ -33,9 +32,9 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "user_id"
t.integer "role", default: 0
t.bigint "inviter_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "active_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "active_at", precision: nil
t.integer "availability", default: 0, null: false
t.boolean "auto_offline", default: true, null: false
t.index ["account_id", "user_id"], name: "uniq_user_id_per_account_id", unique: true
@@ -45,8 +44,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "accounts", id: :serial, force: :cascade do |t|
t.string "name", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.integer "locale", default: 0
t.string "domain", limit: 100
t.string "support_email", limit: 100
@@ -62,8 +61,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "status", default: 0, null: false
t.string "message_id", null: false
t.string "message_checksum", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["message_id", "message_checksum"], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true
end
@@ -72,7 +71,7 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "record_type", null: false
t.bigint "record_id", null: false
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.datetime "created_at", precision: nil, null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end
@@ -83,8 +82,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "content_type"
t.text "metadata"
t.bigint "byte_size", null: false
t.string "checksum", null: false
t.datetime "created_at", null: false
t.string "checksum"
t.datetime "created_at", precision: nil, null: false
t.string "service_name", null: false
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
end
@@ -99,8 +98,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "inbox_id"
t.integer "agent_bot_id"
t.integer "status", default: 0
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "account_id"
end
@@ -108,8 +107,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "name"
t.string "description"
t.string "outgoing_url"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "account_id"
t.integer "bot_type", default: 0
t.jsonb "bot_config", default: {}
@@ -126,8 +125,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.text "content"
t.integer "status"
t.integer "views"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "author_id"
t.bigint "associated_article_id"
t.jsonb "meta", default: {}
@@ -145,8 +144,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.float "coordinates_long", default: 0.0
t.integer "message_id", null: false
t.integer "account_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "fallback_title"
t.string "extension"
t.index ["account_id"], name: "index_attachments_on_account_id"
@@ -167,7 +166,7 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "comment"
t.string "remote_address"
t.string "request_uuid"
t.datetime "created_at"
t.datetime "created_at", precision: nil
t.index ["associated_type", "associated_id"], name: "associated_index"
t.index ["auditable_type", "auditable_id", "version"], name: "auditable_index"
t.index ["created_at"], name: "index_audits_on_created_at"
@@ -182,8 +181,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "event_name", null: false
t.jsonb "conditions", default: "{}", null: false
t.jsonb "actions", default: "{}", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "active", default: true, null: false
t.index ["account_id"], name: "index_automation_rules_on_account_id"
end
@@ -198,12 +197,12 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "account_id", null: false
t.bigint "inbox_id", null: false
t.jsonb "trigger_rules", default: {}
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "campaign_type", default: 0, null: false
t.integer "campaign_status", default: 0, null: false
t.jsonb "audience", default: []
t.datetime "scheduled_at"
t.datetime "scheduled_at", precision: nil
t.boolean "trigger_only_during_business_hours", default: false
t.index ["account_id"], name: "index_campaigns_on_account_id"
t.index ["campaign_status"], name: "index_campaigns_on_campaign_status"
@@ -216,8 +215,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "account_id", null: false
t.string "short_code"
t.text "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "categories", force: :cascade do |t|
@@ -226,8 +225,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "name"
t.text "description"
t.integer "position"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "locale", default: "en"
t.string "slug", null: false
t.bigint "parent_category_id"
@@ -242,8 +241,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "channel_api", force: :cascade do |t|
t.integer "account_id", null: false
t.string "webhook_url"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "identifier"
t.string "hmac_token"
t.boolean "hmac_mandatory", default: false
@@ -256,15 +255,15 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "account_id", null: false
t.string "email", null: false
t.string "forward_to_email", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "imap_enabled", default: false
t.string "imap_address", default: ""
t.integer "imap_port", default: 0
t.string "imap_login", default: ""
t.string "imap_password", default: ""
t.boolean "imap_enable_ssl", default: true
t.datetime "imap_inbox_synced_at"
t.datetime "imap_inbox_synced_at", precision: nil
t.boolean "smtp_enabled", default: false
t.string "smtp_address", default: ""
t.integer "smtp_port", default: 0
@@ -286,8 +285,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "user_access_token", null: false
t.string "page_access_token", null: false
t.integer "account_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "instagram_id"
t.index ["page_id", "account_id"], name: "index_channel_facebook_pages_on_page_id_and_account_id", unique: true
t.index ["page_id"], name: "index_channel_facebook_pages_on_page_id"
@@ -298,8 +297,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "line_channel_id", null: false
t.string "line_channel_secret", null: false
t.string "line_channel_token", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["line_channel_id"], name: "index_channel_line_on_line_channel_id", unique: true
end
@@ -308,8 +307,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "phone_number", null: false
t.string "provider", default: "default"
t.jsonb "provider_config", default: {}
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["phone_number"], name: "index_channel_sms_on_phone_number", unique: true
end
@@ -317,8 +316,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "bot_name"
t.integer "account_id", null: false
t.string "bot_token", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["bot_token"], name: "index_channel_telegram_on_bot_token", unique: true
end
@@ -327,8 +326,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "auth_token", null: false
t.string "account_sid", null: false
t.integer "account_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "medium", default: 0
t.string "messaging_service_sid"
t.index ["account_sid", "phone_number"], name: "index_channel_twilio_sms_on_account_sid_and_phone_number", unique: true
@@ -341,8 +340,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "twitter_access_token", null: false
t.string "twitter_access_token_secret", null: false
t.integer "account_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "tweets_enabled", default: true
t.index ["account_id", "profile_id"], name: "index_channel_twitter_profiles_on_account_id_and_profile_id", unique: true
end
@@ -350,8 +349,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "channel_web_widgets", id: :serial, force: :cascade do |t|
t.string "website_url"
t.integer "account_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "website_token"
t.string "widget_color", default: "#1f93ff"
t.string "welcome_title"
@@ -372,10 +371,10 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "phone_number", null: false
t.string "provider", default: "default"
t.jsonb "provider_config", default: {}
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.jsonb "message_templates", default: {}
t.datetime "message_templates_last_updated"
t.datetime "message_templates_last_updated", precision: nil
t.index ["phone_number"], name: "index_channel_whatsapp_on_phone_number", unique: true
end
@@ -383,8 +382,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "contact_id"
t.bigint "inbox_id"
t.string "source_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "hmac_verified", default: false
t.string "pubsub_token"
t.index ["contact_id"], name: "index_contact_inboxes_on_contact_id"
@@ -399,12 +398,12 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "email"
t.string "phone_number"
t.integer "account_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.jsonb "additional_attributes", default: {}
t.string "identifier"
t.jsonb "custom_attributes", default: {}
t.datetime "last_activity_at"
t.datetime "last_activity_at", precision: nil
t.index "lower((email)::text), account_id", name: "index_contacts_on_lower_email_account_id"
t.index ["account_id"], name: "index_contacts_on_account_id"
t.index ["email", "account_id"], name: "uniq_email_per_account_contact", unique: true
@@ -417,8 +416,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "account_id", null: false
t.bigint "user_id", null: false
t.bigint "conversation_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_conversation_participants_on_account_id"
t.index ["conversation_id"], name: "index_conversation_participants_on_conversation_id"
t.index ["user_id", "conversation_id"], name: "index_conversation_participants_on_user_id_and_conversation_id", unique: true
@@ -430,23 +429,23 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "inbox_id", null: false
t.integer "status", default: 0, null: false
t.integer "assignee_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.bigint "contact_id"
t.integer "display_id", null: false
t.datetime "contact_last_seen_at"
t.datetime "agent_last_seen_at"
t.datetime "contact_last_seen_at", precision: nil
t.datetime "agent_last_seen_at", precision: nil
t.jsonb "additional_attributes", default: {}
t.bigint "contact_inbox_id"
t.uuid "uuid", default: -> { "gen_random_uuid()" }, null: false
t.string "identifier"
t.datetime "last_activity_at", default: -> { "CURRENT_TIMESTAMP" }, null: false
t.datetime "last_activity_at", precision: nil, default: -> { "CURRENT_TIMESTAMP" }, null: false
t.bigint "team_id"
t.bigint "campaign_id"
t.datetime "snoozed_until"
t.datetime "snoozed_until", precision: nil
t.jsonb "custom_attributes", default: {}
t.datetime "assignee_last_seen_at"
t.datetime "first_reply_created_at"
t.datetime "assignee_last_seen_at", precision: nil
t.datetime "first_reply_created_at", precision: nil
t.integer "priority"
t.index ["account_id", "display_id"], name: "index_conversations_on_account_id_and_display_id", unique: true
t.index ["account_id", "id"], name: "index_conversations_on_id_and_account_id"
@@ -474,8 +473,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.text "feedback_message"
t.bigint "contact_id", null: false
t.bigint "assigned_agent_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_csat_survey_responses_on_account_id"
t.index ["assigned_agent_id"], name: "index_csat_survey_responses_on_assigned_agent_id"
t.index ["contact_id"], name: "index_csat_survey_responses_on_contact_id"
@@ -490,8 +489,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "default_value"
t.integer "attribute_model", default: 0
t.bigint "account_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.text "attribute_description"
t.jsonb "attribute_values", default: []
t.index ["account_id"], name: "index_custom_attribute_definitions_on_account_id"
@@ -504,8 +503,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.jsonb "query", default: "{}", null: false
t.bigint "account_id", null: false
t.bigint "user_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_custom_filters_on_account_id"
t.index ["user_id"], name: "index_custom_filters_on_user_id"
end
@@ -515,8 +514,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.jsonb "content", default: []
t.bigint "account_id", null: false
t.bigint "user_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_dashboard_apps_on_account_id"
t.index ["user_id"], name: "index_dashboard_apps_on_user_id"
end
@@ -528,8 +527,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.text "processing_errors"
t.integer "total_records"
t.integer "processed_records"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_data_imports_on_account_id"
end
@@ -539,8 +538,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "account_id"
t.integer "template_type", default: 1
t.integer "locale", default: 0, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["name", "account_id"], name: "index_email_templates_on_name_and_account_id", unique: true
end
@@ -548,15 +547,15 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "account_id", null: false
t.integer "category_id", null: false
t.string "name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "inbox_members", id: :serial, force: :cascade do |t|
t.integer "user_id", null: false
t.integer "inbox_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.index ["inbox_id", "user_id"], name: "index_inbox_members_on_inbox_id_and_user_id", unique: true
t.index ["inbox_id"], name: "index_inbox_members_on_inbox_id"
end
@@ -565,8 +564,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "channel_id", null: false
t.integer "account_id", null: false
t.string "name", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "channel_type"
t.boolean "enable_auto_assignment", default: true
t.boolean "greeting_enabled", default: false
@@ -589,8 +588,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "installation_configs", force: :cascade do |t|
t.string "name", null: false
t.jsonb "serialized_value", default: {}, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "locked", default: true, null: false
t.index ["name", "created_at"], name: "index_installation_configs_on_name_and_created_at", unique: true
t.index ["name"], name: "index_installation_configs_on_name", unique: true
@@ -604,8 +603,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "hook_type", default: 0
t.string "reference_id"
t.string "access_token"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.jsonb "settings", default: {}
end
@@ -615,8 +614,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "color", default: "#1f93ff", null: false
t.boolean "show_on_sidebar"
t.bigint "account_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_labels_on_account_id"
t.index ["title", "account_id"], name: "index_labels_on_title_and_account_id", unique: true
end
@@ -628,8 +627,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "created_by_id"
t.bigint "updated_by_id"
t.jsonb "actions", default: {}, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_macros_on_account_id"
end
@@ -637,9 +636,9 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "user_id", null: false
t.bigint "conversation_id", null: false
t.bigint "account_id", null: false
t.datetime "mentioned_at", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "mentioned_at", precision: nil, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_mentions_on_account_id"
t.index ["conversation_id"], name: "index_mentions_on_conversation_id"
t.index ["user_id", "conversation_id"], name: "index_mentions_on_user_id_and_conversation_id", unique: true
@@ -652,8 +651,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "inbox_id", null: false
t.integer "conversation_id", null: false
t.integer "message_type", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.boolean "private", default: false
t.integer "status", default: 0
t.string "source_id"
@@ -678,8 +677,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "account_id", null: false
t.bigint "contact_id", null: false
t.bigint "user_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_notes_on_account_id"
t.index ["contact_id"], name: "index_notes_on_contact_id"
t.index ["user_id"], name: "index_notes_on_user_id"
@@ -689,8 +688,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "account_id"
t.integer "user_id"
t.integer "email_flags", default: 0, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "push_flags", default: 0, null: false
t.index ["account_id", "user_id"], name: "by_account_user", unique: true
end
@@ -699,8 +698,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "user_id", null: false
t.integer "subscription_type", null: false
t.jsonb "subscription_attributes", default: {}, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "identifier"
t.index ["identifier"], name: "index_notification_subscriptions_on_identifier", unique: true
t.index ["user_id"], name: "index_notification_subscriptions_on_user_id"
@@ -714,9 +713,9 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "primary_actor_id", null: false
t.string "secondary_actor_type"
t.bigint "secondary_actor_id"
t.datetime "read_at"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "read_at", precision: nil
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_notifications_on_account_id"
t.index ["primary_actor_type", "primary_actor_id"], name: "uniq_primary_actor_per_account_notifications"
t.index ["secondary_actor_type", "secondary_actor_id"], name: "uniq_secondary_actor_per_account_notifications"
@@ -727,8 +726,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.bigint "platform_app_id", null: false
t.string "permissible_type", null: false
t.bigint "permissible_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["permissible_type", "permissible_id"], name: "index_platform_app_permissibles_on_permissibles"
t.index ["platform_app_id", "permissible_id", "permissible_type"], name: "unique_permissibles_index", unique: true
t.index ["platform_app_id"], name: "index_platform_app_permissibles_on_platform_app_id"
@@ -736,15 +735,15 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "platform_apps", force: :cascade do |t|
t.string "name", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "portal_members", force: :cascade do |t|
t.bigint "portal_id"
t.bigint "user_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["portal_id", "user_id"], name: "index_portal_members_on_portal_id_and_user_id", unique: true
t.index ["user_id", "portal_id"], name: "index_portal_members_on_user_id_and_portal_id", unique: true
end
@@ -758,8 +757,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "homepage_link"
t.string "page_title"
t.text "header_text"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.jsonb "config", default: {"allowed_locales"=>["en"]}
t.boolean "archived", default: false
t.index ["custom_domain"], name: "index_portals_on_custom_domain", unique: true
@@ -777,8 +776,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "related_categories", force: :cascade do |t|
t.bigint "category_id"
t.bigint "related_category_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["category_id", "related_category_id"], name: "index_related_categories_on_category_id_and_related_category_id", unique: true
t.index ["related_category_id", "category_id"], name: "index_related_categories_on_related_category_id_and_category_id", unique: true
end
@@ -790,11 +789,11 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "inbox_id"
t.integer "user_id"
t.integer "conversation_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.float "value_in_business_hours"
t.datetime "event_start_time"
t.datetime "event_end_time"
t.datetime "event_start_time", precision: nil
t.datetime "event_end_time", precision: nil
t.index ["account_id"], name: "index_reporting_events_on_account_id"
t.index ["conversation_id"], name: "index_reporting_events_on_conversation_id"
t.index ["created_at"], name: "index_reporting_events_on_created_at"
@@ -810,7 +809,7 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "tagger_type"
t.integer "tagger_id"
t.string "context", limit: 128
t.datetime "created_at"
t.datetime "created_at", precision: nil
t.index ["context"], name: "index_taggings_on_context"
t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
t.index ["tag_id"], name: "index_taggings_on_tag_id"
@@ -832,8 +831,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
create_table "team_members", force: :cascade do |t|
t.bigint "team_id", null: false
t.bigint "user_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["team_id", "user_id"], name: "index_team_members_on_team_id_and_user_id", unique: true
t.index ["team_id"], name: "index_team_members_on_team_id"
t.index ["user_id"], name: "index_team_members_on_user_id"
@@ -844,8 +843,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.text "description"
t.boolean "allow_auto_assign", default: true
t.bigint "account_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_teams_on_account_id"
t.index ["name", "account_id"], name: "index_teams_on_name_and_account_id", unique: true
end
@@ -854,8 +853,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "name"
t.string "auth_key"
t.integer "account_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
end
create_table "users", id: :serial, force: :cascade do |t|
@@ -863,23 +862,23 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.string "uid", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.datetime "reset_password_sent_at", precision: nil
t.datetime "remember_created_at", precision: nil
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.datetime "current_sign_in_at", precision: nil
t.datetime "last_sign_in_at", precision: nil
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.datetime "confirmed_at", precision: nil
t.datetime "confirmation_sent_at", precision: nil
t.string "unconfirmed_email"
t.string "name", null: false
t.string "display_name"
t.string "email"
t.json "tokens"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "pubsub_token"
t.integer "availability", default: 0
t.jsonb "ui_settings", default: {}
@@ -896,8 +895,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "account_id"
t.integer "inbox_id"
t.string "url"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "webhook_type", default: 0
t.jsonb "subscriptions", default: ["conversation_status_changed", "conversation_updated", "conversation_created", "contact_created", "contact_updated", "message_created", "message_updated", "webwidget_triggered"]
t.index ["account_id", "url"], name: "index_webhooks_on_account_id_and_url", unique: true
@@ -912,8 +911,8 @@ ActiveRecord::Schema.define(version: 2023_04_26_130150) do
t.integer "open_minutes"
t.integer "close_hour"
t.integer "close_minutes"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "open_all_day", default: false
t.index ["account_id"], name: "index_working_hours_on_account_id"
t.index ["inbox_id"], name: "index_working_hours_on_inbox_id"