choore: Change values to attribute_values in custom attributes (#3413)

This commit is contained in:
Muhsin Keloth 2021-11-18 18:59:28 +05:30 committed by GitHub
parent a3ba8f9e35
commit bf96e8b68d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 4 deletions

View file

@ -39,7 +39,7 @@ class Api::V1::Accounts::CustomAttributeDefinitionsController < Api::V1::Account
:attribute_display_type,
:attribute_key,
:attribute_model,
:default_value
attribute_values: []
)
end

View file

@ -8,8 +8,8 @@
# attribute_display_type :integer default("text")
# attribute_key :string
# attribute_model :integer default("conversation_attribute")
# attribute_values :jsonb
# default_value :integer
# values :jsonb
# created_at :datetime not null
# updated_at :datetime not null
# account_id :bigint

View file

@ -3,6 +3,7 @@ json.attribute_display_name resource.attribute_display_name
json.attribute_display_type resource.attribute_display_type
json.attribute_description resource.attribute_description
json.attribute_key resource.attribute_key
json.attribute_values resource.attribute_values
json.attribute_model resource.attribute_model
json.default_value resource.default_value
json.created_at resource.created_at

View file

@ -0,0 +1,5 @@
class ChangeValuesToAttributeValuesInCustomAttributeDefinitions < ActiveRecord::Migration[6.1]
def change
rename_column :custom_attribute_definitions, :values, :attribute_values
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_11_16_131740) do
ActiveRecord::Schema.define(version: 2021_11_18_100301) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
@ -355,7 +355,7 @@ ActiveRecord::Schema.define(version: 2021_11_16_131740) do
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.text "attribute_description"
t.jsonb "values", default: []
t.jsonb "attribute_values", default: []
t.index ["account_id"], name: "index_custom_attribute_definitions_on_account_id"
t.index ["attribute_key", "attribute_model"], name: "attribute_key_model_index", unique: true
end