adjust migration

This commit is contained in:
Pete Matsyburka
2024-10-22 23:40:30 +03:00
parent 4332b4ebb8
commit 90d86b58c2
6 changed files with 48 additions and 30 deletions
+2
View File
@@ -17,4 +17,6 @@
#
class CompletedDocument < ApplicationRecord
belongs_to :submitter
has_one :completed_submitter, primary_key: :submitter_id, inverse_of: :completed_documents, dependent: :destroy
end
+7 -1
View File
@@ -17,11 +17,17 @@
#
# Indexes
#
# index_completed_submitters_on_account_id (account_id)
# index_completed_submitters_on_account_id (account_id)
# index_completed_submitters_on_submitter_id (submitter_id)
#
class CompletedSubmitter < ApplicationRecord
belongs_to :submitter
belongs_to :submission
belongs_to :account
belongs_to :template
has_many :completed_documents, dependent: :destroy,
primary_key: :submitter_id,
foreign_key: :submitter_id,
inverse_of: :submitter
end