fix: Index custom attribute uniqueness on account (#3516)

- Move custom attribute uniqueness validation to account
This commit is contained in:
Muhsin Keloth
2021-12-07 18:20:47 +05:30
committed by GitHub
parent 6b025816f5
commit 46afcd9348
3 changed files with 11 additions and 4 deletions

View File

@@ -0,0 +1,7 @@
class RemoveAttributeKeyIndexOnCustomAttributeDefinition < ActiveRecord::Migration[6.1]
def change
remove_index :custom_attribute_definitions, [:attribute_key, :account_id], name: 'attribute_key_model_index',
if_exists: true
add_index :custom_attribute_definitions, [:attribute_key, :account_id], unique: true, name: 'attribute_key_index', if_not_exists: true
end
end