diff --git a/app/models/location.rb b/app/models/location.rb index 754e63b33..b37687ae4 100644 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -39,7 +39,6 @@ class Location < ApplicationRecord { name: "Location code ", value: location_code, suffix: false }, { name: "Postcode", value: postcode, suffix: county }, { name: "Type of unit", value: type_of_unit, suffix: false }, - { name: "Type of building", value: type_of_building, suffix: false }, ] end diff --git a/db/migrate/20220802125711_remove_type_of_building.rb b/db/migrate/20220802125711_remove_type_of_building.rb new file mode 100644 index 000000000..913193f36 --- /dev/null +++ b/db/migrate/20220802125711_remove_type_of_building.rb @@ -0,0 +1,5 @@ +class RemoveTypeOfBuilding < ActiveRecord::Migration[7.0] + def change + remove_column :locations, :type_of_building, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 39bc35e94..8ead19234 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: 2022_07_22_083835) do +ActiveRecord::Schema[7.0].define(version: 2022_08_02_125711) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -239,7 +239,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_07_22_083835) do create_table "locations", force: :cascade do |t| t.string "location_code" t.string "postcode" - t.string "type_of_building" t.bigint "scheme_id", null: false t.string "name" t.datetime "created_at", null: false diff --git a/db/seeds.rb b/db/seeds.rb index 86f6d3395..e9cd10b85 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -122,7 +122,6 @@ unless Rails.env.test? name: "Rectory Road", type_of_unit: 4, units: 1, - type_of_building: "Purpose built", mobility_type: "N", ) @@ -133,7 +132,6 @@ unless Rails.env.test? name: "Smithy Lane", type_of_unit: 1, units: 1, - type_of_building: "Converted from previous residential or non-residential property", mobility_type: "W", ) @@ -144,7 +142,6 @@ unless Rails.env.test? name: "Smithy Lane", type_of_unit: 2, units: 1, - type_of_building: "Converted from previous residential or non-residential property", mobility_type: "W", ) end diff --git a/spec/factories/location.rb b/spec/factories/location.rb index 4d3fb1e4c..433eedd6f 100644 --- a/spec/factories/location.rb +++ b/spec/factories/location.rb @@ -4,7 +4,6 @@ FactoryBot.define do name { Faker::Address.street_name } type_of_unit { [1, 2, 3, 4, 6, 7].sample } units { [1, 2, 3, 4, 6, 7].sample } - type_of_building { "Purpose built" } mobility_type { %w[A M N W X].sample } location_code { "E09000033" } location_admin_district { "Westminster" } diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index 9ffb03eae..6b9c9658f 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -1689,7 +1689,7 @@ RSpec.describe CaseLog do context "and not renewal" do let(:scheme) { FactoryBot.create(:scheme) } - let(:location) { FactoryBot.create(:location, scheme:, postcode: "M11AE", type_of_unit: 1, type_of_building: "Purpose built", mobility_type: "W") } + let(:location) { FactoryBot.create(:location, scheme:, postcode: "M11AE", type_of_unit: 1, mobility_type: "W") } let(:supported_housing_case_log) do described_class.create!({