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:
Sebastian Serth
2023-03-20 23:50:12 +01:00
parent 5a36e57b9f
commit e3e6fc3af1
5 changed files with 26 additions and 3 deletions

View File

@ -4,7 +4,7 @@ class StructuredError < ApplicationRecord
belongs_to :error_template
belongs_to :submission
has_many :structured_error_attributes
has_many :structured_error_attributes, dependent: :destroy
def self.create_from_template(template, message_buffer, submission)
create(