diff --git a/app/constants/db_enums.rb b/app/constants/db_enums.rb index d930fc8d4..99b7b438a 100644 --- a/app/constants/db_enums.rb +++ b/app/constants/db_enums.rb @@ -191,4 +191,17 @@ module DbEnums "Relet – tenant involved in a succession downsize" => 19, } end + + def self.unittype_gn + { + "Flat / maisonette" => 1, + "Bed-sit" => 2, + "House" => 7, + "Bungalow" => 8, + "Shared flat / maisonette" => 4, + "Shared house" => 9, + "Shared bungalow" => 10, + "Other" => 6, + } + end end diff --git a/app/models/case_log.rb b/app/models/case_log.rb index ba5c7bbfb..f6b4535d0 100644 --- a/app/models/case_log.rb +++ b/app/models/case_log.rb @@ -85,6 +85,7 @@ class CaseLog < ApplicationRecord enum tenancy: DbEnums.tenancy, _suffix: true enum landlord: DbEnums.landlord, _suffix: true enum rsnvac: DbEnums.rsnvac, _suffix: true + enum unittype_gn: DbEnums.unittype_gn, _suffix: true enum rp_homeless: DbEnums.polar, _suffix: true enum rp_insan_unsat: DbEnums.polar, _suffix: true diff --git a/db/migrate/20211103090530_change_field_types.rb b/db/migrate/20211103090530_change_field_types.rb index fbfb20201..3a006cad8 100644 --- a/db/migrate/20211103090530_change_field_types.rb +++ b/db/migrate/20211103090530_change_field_types.rb @@ -47,6 +47,7 @@ class ChangeFieldTypes < ActiveRecord::Migration[6.1] t.change :tenancy, "integer USING tenancy::integer" t.change :landlord, "integer USING landlord::integer" t.change :rsnvac, "integer USING rsnvac::integer" + t.change :unittype_gn, "integer USING unittype_gn::integer" end end @@ -98,6 +99,7 @@ class ChangeFieldTypes < ActiveRecord::Migration[6.1] t.change :tenancy, :string t.change :landlord, :string t.change :rsnvac, :string + t.change :unittype_gn, :string end end end diff --git a/db/schema.rb b/db/schema.rb index 5066c9ae0..72534b28e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -78,7 +78,7 @@ ActiveRecord::Schema.define(version: 2021_11_03_090530) do t.string "property_relet" t.integer "rsnvac" t.string "property_reference" - t.string "unittype_gn" + t.integer "unittype_gn" t.string "property_building_type" t.string "beds" t.string "property_void_date"