From 27ba9cd49dfecb6c4361b9ef0832aba90c328dfc Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 30 Nov 2021 09:13:31 +0000 Subject: [PATCH] Add renttype column --- db/migrate/20211130090246_add_rent_type.rb | 7 +++++++ db/schema.rb | 3 ++- spec/factories/case_log.rb | 1 + spec/fixtures/complete_case_log.json | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20211130090246_add_rent_type.rb diff --git a/db/migrate/20211130090246_add_rent_type.rb b/db/migrate/20211130090246_add_rent_type.rb new file mode 100644 index 000000000..5df05be91 --- /dev/null +++ b/db/migrate/20211130090246_add_rent_type.rb @@ -0,0 +1,7 @@ +class AddRentType < ActiveRecord::Migration[6.1] + def change + change_table :case_logs, bulk: true do |t| + t.column :renttype, :integer + end + end +end diff --git a/db/schema.rb b/db/schema.rb index e88f28f52..393589bb2 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.define(version: 2021_11_26_142105) do +ActiveRecord::Schema.define(version: 2021_11_30_090246) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -168,6 +168,7 @@ ActiveRecord::Schema.define(version: 2021_11_26_142105) do t.bigint "owning_organisation_id" t.bigint "managing_organisation_id" t.datetime "property_void_date" + t.integer "renttype" t.index ["discarded_at"], name: "index_case_logs_on_discarded_at" t.index ["managing_organisation_id"], name: "index_case_logs_on_managing_organisation_id" t.index ["owning_organisation_id"], name: "index_case_logs_on_owning_organisation_id" diff --git a/spec/factories/case_log.rb b/spec/factories/case_log.rb index dd636f9d9..17cc1ddff 100644 --- a/spec/factories/case_log.rb +++ b/spec/factories/case_log.rb @@ -137,6 +137,7 @@ FactoryBot.define do armedforces { 1 } builtype { 1 } unitletas { 2 } + renttype { 1 } end created_at { Time.zone.now } updated_at { Time.zone.now } diff --git a/spec/fixtures/complete_case_log.json b/spec/fixtures/complete_case_log.json index 88e72fc34..a01ae395a 100644 --- a/spec/fixtures/complete_case_log.json +++ b/spec/fixtures/complete_case_log.json @@ -143,6 +143,7 @@ "property_wheelchair_accessible": "Yes", "void_or_renewal_date": "05/05/2020", "tenant_same_property_renewal": "Yes", - "new_build_handover_date": "01/01/2019" + "new_build_handover_date": "01/01/2019", + "renttype": 1 } }