use join table instead of arrays
This commit is contained in:
parent
7679ba26b2
commit
378f3c5fb0
10 changed files with 100 additions and 41 deletions
10
db/migrate/20221222204553_create_dossier_batch_operations.rb
Normal file
10
db/migrate/20221222204553_create_dossier_batch_operations.rb
Normal 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
|
10
db/schema.rb
10
db/schema.rb
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue