Fix missing/incorrect Model specifications in migrations
We need to define the required models within the migration (not below) to work reliably.
This commit is contained in:

committed by
Sebastian Serth

parent
cef961a1e7
commit
6c44ffbd5c
@@ -1,6 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MigrateTestruns < ActiveRecord::Migration[6.1]
|
||||
class Testrun < ApplicationRecord
|
||||
belongs_to :submission, optional: true
|
||||
has_many :testrun_messages
|
||||
end
|
||||
|
||||
class Submission < ApplicationRecord
|
||||
has_many :testruns
|
||||
end
|
||||
|
||||
class TestrunMessage < ApplicationRecord
|
||||
belongs_to :testrun
|
||||
end
|
||||
|
||||
# We are not changing any tables but only backfilling data.
|
||||
disable_ddl_transaction!
|
||||
|
||||
|
Reference in New Issue
Block a user