feat: run migration

This commit is contained in:
Shivam Mishra
2025-08-25 13:09:20 +05:30
parent 67b8674337
commit a197f64d2c
3 changed files with 64 additions and 2 deletions
+27 -2
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2025_08_22_061042) do
ActiveRecord::Schema[7.1].define(version: 2025_08_25_070824) do
# These extensions should be enabled to support this database
enable_extension "pg_stat_statements"
enable_extension "pg_trgm"
@@ -28,6 +28,20 @@ ActiveRecord::Schema[7.1].define(version: 2025_08_22_061042) do
t.index ["token"], name: "index_access_tokens_on_token", unique: true
end
create_table "account_saml_settings", force: :cascade do |t|
t.bigint "account_id", null: false
t.boolean "enabled", default: false, null: false
t.string "sso_url"
t.string "certificate_fingerprint"
t.text "certificate"
t.string "sp_entity_id"
t.boolean "enforced_sso", default: false, null: false
t.json "attribute_mappings", default: {}
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_account_saml_settings_on_account_id"
end
create_table "account_users", force: :cascade do |t|
t.bigint "account_id"
t.bigint "user_id"
@@ -265,7 +279,7 @@ ActiveRecord::Schema[7.1].define(version: 2025_08_22_061042) do
t.jsonb "audience", default: []
t.datetime "scheduled_at", precision: nil
t.boolean "trigger_only_during_business_hours", default: false
t.jsonb "template_params"
t.jsonb "template_params", default: {}, null: false
t.index ["account_id"], name: "index_campaigns_on_account_id"
t.index ["campaign_status"], name: "index_campaigns_on_campaign_status"
t.index ["campaign_type"], name: "index_campaigns_on_campaign_type"
@@ -1056,6 +1070,17 @@ ActiveRecord::Schema[7.1].define(version: 2025_08_22_061042) do
t.index ["user_id"], name: "index_reporting_events_on_user_id"
end
create_table "saml_role_mappings", force: :cascade do |t|
t.bigint "account_saml_settings_id", null: false
t.string "saml_group_name", null: false
t.integer "role", default: 0, null: false
t.bigint "custom_role_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_saml_settings_id"], name: "index_saml_role_mappings_on_account_saml_settings_id"
t.index ["custom_role_id"], name: "index_saml_role_mappings_on_custom_role_id"
end
create_table "sla_events", force: :cascade do |t|
t.bigint "applied_sla_id", null: false
t.bigint "conversation_id", null: false
@@ -1,3 +1,23 @@
# == Schema Information
#
# Table name: account_saml_settings
#
# id :bigint not null, primary key
# attribute_mappings :json
# certificate :text
# certificate_fingerprint :string
# enabled :boolean default(FALSE), not null
# enforced_sso :boolean default(FALSE), not null
# sso_url :string
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint not null
# sp_entity_id :string
#
# Indexes
#
# index_account_saml_settings_on_account_id (account_id)
#
class AccountSamlSettings < ApplicationRecord
belongs_to :account
has_many :saml_role_mappings, dependent: :destroy
@@ -1,3 +1,20 @@
# == Schema Information
#
# Table name: saml_role_mappings
#
# id :bigint not null, primary key
# role :integer default("agent"), not null
# saml_group_name :string not null
# created_at :datetime not null
# updated_at :datetime not null
# account_saml_settings_id :bigint not null
# custom_role_id :bigint
#
# Indexes
#
# index_saml_role_mappings_on_account_saml_settings_id (account_saml_settings_id)
# index_saml_role_mappings_on_custom_role_id (custom_role_id)
#
class SamlRoleMapping < ApplicationRecord
belongs_to :account_saml_settings
belongs_to :custom_role, optional: true