From edfbf392bf2c44d9078e68c3be79411d191c1db1 Mon Sep 17 00:00:00 2001 From: bedrock-adam Date: Sun, 24 Nov 2024 21:50:14 +1100 Subject: [PATCH] add lock_version --- db/migrate/20240413100944_create_accountify_organisations.rb | 2 ++ db/migrate/20240527212747_create_accountify_contacts.rb | 2 ++ db/migrate/20240529212144_create_accountify_invoices.rb | 2 ++ ...20240706053510_create_accountify_invoice_status_summary.rb | 2 ++ db/schema.rb | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/db/migrate/20240413100944_create_accountify_organisations.rb b/db/migrate/20240413100944_create_accountify_organisations.rb index 54aaa82..f007463 100644 --- a/db/migrate/20240413100944_create_accountify_organisations.rb +++ b/db/migrate/20240413100944_create_accountify_organisations.rb @@ -3,6 +3,8 @@ def change create_table :accountify_organisations do |t| t.bigint :tenant_id, null: false + t.integer :lock_version, default: 0, null: false + t.text :name, null: false t.datetime :deleted_at diff --git a/db/migrate/20240527212747_create_accountify_contacts.rb b/db/migrate/20240527212747_create_accountify_contacts.rb index 72dccf8..0564a51 100644 --- a/db/migrate/20240527212747_create_accountify_contacts.rb +++ b/db/migrate/20240527212747_create_accountify_contacts.rb @@ -3,6 +3,8 @@ def change create_table :accountify_contacts do |t| t.bigint :tenant_id, null: false, index: true + t.integer :lock_version, default: 0, null: false + t.references :organisation, null: false, foreign_key: { to_table: :accountify_organisations }, index: true diff --git a/db/migrate/20240529212144_create_accountify_invoices.rb b/db/migrate/20240529212144_create_accountify_invoices.rb index aef089d..ea435c5 100644 --- a/db/migrate/20240529212144_create_accountify_invoices.rb +++ b/db/migrate/20240529212144_create_accountify_invoices.rb @@ -3,6 +3,8 @@ def change create_table :accountify_invoices do |t| t.bigint :tenant_id, null: false, index: true + t.integer :lock_version, default: 0, null: false + t.references :organisation, null: false, foreign_key: { to_table: :accountify_organisations }, index: true diff --git a/db/migrate/20240706053510_create_accountify_invoice_status_summary.rb b/db/migrate/20240706053510_create_accountify_invoice_status_summary.rb index 40ca6fe..bb3c346 100644 --- a/db/migrate/20240706053510_create_accountify_invoice_status_summary.rb +++ b/db/migrate/20240706053510_create_accountify_invoice_status_summary.rb @@ -3,6 +3,8 @@ def change create_table :accountify_invoice_status_summaries do |t| t.bigint :tenant_id, null: false + t.integer :lock_version, default: 0, null: false + t.references :organisation, null: false, foreign_key: { to_table: :accountify_organisations }, index: true diff --git a/db/schema.rb b/db/schema.rb index 18b87cd..3f510cc 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -16,6 +16,7 @@ create_table "accountify_contacts", force: :cascade do |t| t.bigint "tenant_id", null: false + t.integer "lock_version", default: 0, null: false t.bigint "organisation_id", null: false t.string "first_name", null: false t.string "last_name", null: false @@ -39,6 +40,7 @@ create_table "accountify_invoice_status_summaries", force: :cascade do |t| t.bigint "tenant_id", null: false + t.integer "lock_version", default: 0, null: false t.bigint "organisation_id", null: false t.integer "drafted_count", null: false t.integer "issued_count", null: false @@ -53,6 +55,7 @@ create_table "accountify_invoices", force: :cascade do |t| t.bigint "tenant_id", null: false + t.integer "lock_version", default: 0, null: false t.bigint "organisation_id", null: false t.bigint "contact_id", null: false t.string "status", null: false @@ -72,6 +75,7 @@ create_table "accountify_organisations", force: :cascade do |t| t.bigint "tenant_id", null: false + t.integer "lock_version", default: 0, null: false t.text "name", null: false t.datetime "deleted_at" t.datetime "created_at", null: false