From f0ffadff9a184f2d876de8e45f49e77acb891302 Mon Sep 17 00:00:00 2001 From: Jack S Date: Wed, 15 Mar 2023 10:12:42 +0000 Subject: [PATCH] Add new UPRN and address columns to logs --- db/migrate/20230301170338_add_uprn_to_logs.rb | 15 +++++++++++++++ db/migrate/20230306110210_add_address_to_logs.rb | 15 +++++++++++++++ db/schema.rb | 14 ++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 db/migrate/20230301170338_add_uprn_to_logs.rb create mode 100644 db/migrate/20230306110210_add_address_to_logs.rb diff --git a/db/migrate/20230301170338_add_uprn_to_logs.rb b/db/migrate/20230301170338_add_uprn_to_logs.rb new file mode 100644 index 000000000..ba354c619 --- /dev/null +++ b/db/migrate/20230301170338_add_uprn_to_logs.rb @@ -0,0 +1,15 @@ +class AddUprnToLogs < ActiveRecord::Migration[7.0] + def change + change_table :sales_logs, bulk: true do |t| + t.column :uprn, :string + t.column :uprn_known, :integer + t.column :uprn_confirmed, :integer + end + + change_table :lettings_logs, bulk: true do |t| + t.column :uprn, :string + t.column :uprn_known, :integer + t.column :uprn_confirmed, :integer + end + end +end diff --git a/db/migrate/20230306110210_add_address_to_logs.rb b/db/migrate/20230306110210_add_address_to_logs.rb new file mode 100644 index 000000000..6562aa742 --- /dev/null +++ b/db/migrate/20230306110210_add_address_to_logs.rb @@ -0,0 +1,15 @@ +class AddAddressToLogs < ActiveRecord::Migration[7.0] + change_table :sales_logs, bulk: true do |t| + t.column :address_line1, :string + t.column :address_line2, :string + t.column :town_or_city, :string + t.column :county, :string + end + + change_table :lettings_logs, bulk: true do |t| + t.column :address_line1, :string + t.column :address_line2, :string + t.column :town_or_city, :string + t.column :county, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 085419473..3f21ceb23 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -279,6 +279,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_08_101826) do t.boolean "unresolved" t.bigint "updated_by_id" t.bigint "bulk_upload_id" + t.string "uprn" + t.integer "uprn_known" + t.integer "uprn_confirmed" + t.string "address_line1" + t.string "address_line2" + t.string "town_or_city" + t.string "county" t.index ["bulk_upload_id"], name: "index_lettings_logs_on_bulk_upload_id" t.index ["created_by_id"], name: "index_lettings_logs_on_created_by_id" t.index ["location_id"], name: "index_lettings_logs_on_location_id" @@ -545,6 +552,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_08_101826) do t.integer "buy2living" t.integer "prevtenbuy2" t.integer "nationalbuy2" + t.string "uprn" + t.integer "uprn_known" + t.integer "uprn_confirmed" + t.string "address_line1" + t.string "address_line2" + t.string "town_or_city" + t.string "county" 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