diff --git a/app/models/saml_app_config.rb b/app/models/saml_app_config.rb index 1fa8c35c..9365d844 100644 --- a/app/models/saml_app_config.rb +++ b/app/models/saml_app_config.rb @@ -2,6 +2,8 @@ class SamlAppConfig < ApplicationRecord belongs_to :group belongs_to :organisation + serialize :config, JSON + def self.get_config(app_name, org_id) SamlAppConfig.find_or_initialize_by( app_name: app_name, organisation_id: org_id diff --git a/db/schema.rb b/db/schema.rb index 754f724a..bf7e20a2 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -124,11 +124,11 @@ create_table "saml_app_configs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t| t.integer "group_id" t.string "sso_url" - t.json "config" + t.text "config", limit: 4294967295, collation: "utf8mb4_bin" t.integer "organisation_id" t.string "app_name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false t.index ["group_id"], name: "index_saml_app_configs_on_group_id", using: :btree t.index ["organisation_id"], name: "index_saml_app_configs_on_organisation_id", using: :btree end