use join table instead of arrays

This commit is contained in:
Paul Chavard 2022-12-22 22:23:47 +01:00 committed by Lisa Durand
parent 7679ba26b2
commit 378f3c5fb0
10 changed files with 100 additions and 41 deletions

View file

@ -0,0 +1,10 @@
class CreateDossierBatchOperations < ActiveRecord::Migration[6.1]
def change
create_table :dossier_batch_operations do |t|
t.references :dossier, null: false, foreign_key: true
t.references :batch_operation, null: false, foreign_key: true
t.string :state, null: false, default: DossierBatchOperation.states.fetch(:pending)
t.timestamps
end
end
end

View file

@ -297,6 +297,16 @@ ActiveRecord::Schema.define(version: 2022_12_27_084442) do
t.index ["procedure_id"], name: "index_deleted_dossiers_on_procedure_id"
end
create_table "dossier_batch_operations", force: :cascade do |t|
t.bigint "batch_operation_id", null: false
t.datetime "created_at", precision: 6, null: false
t.bigint "dossier_id", null: false
t.string "state", default: "pending", null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["batch_operation_id"], name: "index_dossier_batch_operations_on_batch_operation_id"
t.index ["dossier_id"], name: "index_dossier_batch_operations_on_dossier_id"
end
create_table "dossier_operation_logs", force: :cascade do |t|
t.boolean "automatic_operation", default: false, null: false
t.bigint "bill_signature_id"