From 7f929e054cd35fcfff553b79c8e909c4b29687cb Mon Sep 17 00:00:00 2001 From: Kat Date: Fri, 17 Feb 2023 08:07:48 +0000 Subject: [PATCH] Add old id column --- db/migrate/20230215112932_add_old_id_to_sales_logs.rb | 8 ++++++++ db/schema.rb | 10 ++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20230215112932_add_old_id_to_sales_logs.rb diff --git a/db/migrate/20230215112932_add_old_id_to_sales_logs.rb b/db/migrate/20230215112932_add_old_id_to_sales_logs.rb new file mode 100644 index 000000000..cf61a968c --- /dev/null +++ b/db/migrate/20230215112932_add_old_id_to_sales_logs.rb @@ -0,0 +1,8 @@ +class AddOldIdToSalesLogs < ActiveRecord::Migration[7.0] + def change + change_table :sales_logs, bulk: true do |t| + t.column :old_id, :string + end + add_index :sales_logs, :old_id, unique: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 1747fa6c5..d1668b738 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_02_13_140932) do +ActiveRecord::Schema[7.0].define(version: 2023_02_15_112932) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -522,16 +522,18 @@ ActiveRecord::Schema[7.0].define(version: 2023_02_13_140932) do t.integer "old_persons_shared_ownership_value_check" t.integer "staircase_bought_value_check" t.integer "monthly_charges_value_check" + t.integer "saledate_check" t.integer "details_known_5" t.integer "details_known_6" - t.integer "saledate_check" - t.integer "prevshared" - t.integer "staircasesale" t.integer "ethnic_group2" t.integer "ethnicbuy2" t.integer "proplen_asked" + t.integer "prevshared" + t.integer "staircasesale" + t.string "old_id" t.index ["bulk_upload_id"], name: "index_sales_logs_on_bulk_upload_id" t.index ["created_by_id"], name: "index_sales_logs_on_created_by_id" + t.index ["old_id"], name: "index_sales_logs_on_old_id", unique: true t.index ["owning_organisation_id"], name: "index_sales_logs_on_owning_organisation_id" t.index ["updated_by_id"], name: "index_sales_logs_on_updated_by_id" end