Merge pull request #5748 from betagouv/remove-dossier-operation-logs-foreign-key

Remove foreign key dossier  on dossier operations logs
This commit is contained in:
Paul Chavard 2020-11-17 16:32:15 +01:00 committed by GitHub
commit 935e35d0fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View file

@ -74,7 +74,7 @@ class Dossier < ApplicationRecord
has_many :avis, inverse_of: :dossier, dependent: :destroy
has_many :traitements, -> { order(:processed_at) }, inverse_of: :dossier, dependent: :destroy
has_many :dossier_operation_logs, -> { order(:created_at) }, dependent: :nullify, inverse_of: :dossier
has_many :dossier_operation_logs, -> { order(:created_at) }, inverse_of: :dossier
belongs_to :groupe_instructeur, optional: false
belongs_to :revision, class_name: 'ProcedureRevision', optional: false

View file

@ -0,0 +1,5 @@
class RemoveDossierOperationLogForeignKey < ActiveRecord::Migration[6.0]
def change
remove_foreign_key :dossier_operation_logs, :dossiers
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_11_10_155516) do
ActiveRecord::Schema.define(version: 2020_11_17_122923) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -709,7 +709,6 @@ ActiveRecord::Schema.define(version: 2020_11_10_155516) do
add_foreign_key "closed_mails", "procedures"
add_foreign_key "commentaires", "dossiers"
add_foreign_key "dossier_operation_logs", "bill_signatures"
add_foreign_key "dossier_operation_logs", "dossiers"
add_foreign_key "dossier_operation_logs", "instructeurs"
add_foreign_key "dossiers", "groupe_instructeurs"
add_foreign_key "dossiers", "procedure_revisions", column: "revision_id"