Add foreign keys and an index to StructuredError(Attributes)
These changes will ensure a better data consistency and faster access. We further ensure that records should be deleted properly.
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddForeignKeysToStructuredErrors < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_foreign_key :structured_errors, :submissions
|
||||
add_foreign_key :structured_errors, :error_templates
|
||||
end
|
||||
end
|
@ -0,0 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddForeignKeysAndIndexToStructuredErrorAttributes < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
add_foreign_key :structured_error_attributes, :structured_errors
|
||||
add_foreign_key :structured_error_attributes, :error_template_attributes
|
||||
add_index :structured_error_attributes, :structured_error_id
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user