6 changed files with 80 additions and 76 deletions
@ -1,33 +1,58 @@ |
|||||||
class FurtherCoreMigrations < ActiveRecord::Migration[6.1] |
class FurtherCoreMigrations < ActiveRecord::Migration[6.1] |
||||||
def up |
def up |
||||||
remove_column :case_logs, :condition_effects_prefer_not_to_say |
change_table :case_logs, bulk: true do |t| |
||||||
rename_column :case_logs, :reason_for_leaving_last_settled_home, :reason |
t.remove :condition_effects_prefer_not_to_say |
||||||
rename_column :case_logs, :property_reference, :propcode |
t.remove :reason_for_leaving_last_settled_home |
||||||
rename_column :case_logs, :property_major_repairs, :majorrepairs |
t.column :reason, :integer |
||||||
rename_column :case_logs, :property_location, :la |
t.remove :property_reference |
||||||
rename_column :case_logs, :previous_la, :prevloc |
t.column :propcode, :string |
||||||
rename_column :case_logs, :housing_benefit, :hb |
t.remove :property_major_repairs |
||||||
rename_column :case_logs, :outstanding_rent_or_charges, :hbrentshortfall |
t.column :majorrepairs, :integer |
||||||
rename_column :case_logs, :outstanding_amount, :tshortfall |
t.remove :property_location |
||||||
add_column :case_logs, :postcode, :string |
t.column :la, :string |
||||||
add_column :case_logs, :postcod2, :string |
t.remove :previous_la |
||||||
add_column :case_logs, :ppostc1, :string |
t.column :prevloc, :string |
||||||
add_column :case_logs, :ppostc2, :string |
t.remove :housing_benefit |
||||||
|
t.column :hb, :integer |
||||||
|
t.remove :outstanding_rent_or_charges |
||||||
|
t.column :hbrentshortfall, :integer |
||||||
|
t.remove :outstanding_amount |
||||||
|
t.column :tshortfall, :integer |
||||||
|
t.column :postcode, :string |
||||||
|
t.column :postcod2, :string |
||||||
|
t.column :ppostc1, :string |
||||||
|
t.column :ppostc2, :string |
||||||
|
t.remove :property_relet |
||||||
|
t.column :property_relet, :integer |
||||||
|
end |
||||||
end |
end |
||||||
|
|
||||||
def down |
def down |
||||||
add_column :case_logs, :condition_effects_prefer_not_to_say, :integer |
change_table :case_logs, bulk: true do |t| |
||||||
rename_column :case_logs, :reason, :reason_for_leaving_last_settled_home |
t.column :condition_effects_prefer_not_to_say, :integer |
||||||
rename_column :case_logs, :propcode, :property_reference |
t.column :condition_effects_prefer_not_to_say, :integer |
||||||
rename_column :case_logs, :majorrepairs, :property_major_repairs |
t.column :reason_for_leaving_last_settled_home, :string |
||||||
rename_column :case_logs, :la, :property_location |
t.remove :reason |
||||||
rename_column :case_logs, :prevloc, :previous_la |
t.column :property_reference, :string |
||||||
rename_column :case_logs, :hb, :housing_benefit |
t.remove :propcode |
||||||
rename_column :case_logs, :hbrentshortfall, :outstanding_rent_or_charges |
t.column :property_major_repairs, :string |
||||||
rename_column :case_logs, :tshortfall, :outstanding_amount |
t.remove :majorrepairs |
||||||
remove_column :case_logs, :postcode |
t.column :property_location, :string |
||||||
remove_column :case_logs, :postcod2 |
t.remove :la |
||||||
remove_column :case_logs, :ppostc1 |
t.column :previous_la, :string |
||||||
remove_column :case_logs, :ppostc2 |
t.remove :prevloc |
||||||
|
t.column :housing_benefit, :string |
||||||
|
t.remove :hb |
||||||
|
t.column :outstanding_rent_or_charges, :string |
||||||
|
t.remove :hbrentshortfall |
||||||
|
t.column :outstanding_amount, :string |
||||||
|
t.remove :tshortfall |
||||||
|
t.remove :postcode |
||||||
|
t.remove :postcod2 |
||||||
|
t.remove :ppostc1 |
||||||
|
t.remove :ppostc2 |
||||||
|
t.remove :property_relet |
||||||
|
t.column :property_relet, :string |
||||||
|
end |
||||||
end |
end |
||||||
end |
end |
||||||
|
@ -1,21 +0,0 @@ |
|||||||
class FurtherChangeFieldTypes < ActiveRecord::Migration[6.1] |
|
||||||
def up |
|
||||||
change_table :case_logs, bulk: true do |t| |
|
||||||
t.change :reason, "integer USING reason::integer" |
|
||||||
t.change :majorrepairs, "integer USING majorrepairs::integer" |
|
||||||
t.change :hb, "integer USING hb::integer" |
|
||||||
t.change :hbrentshortfall, "integer USING hbrentshortfall::integer" |
|
||||||
t.change :tshortfall, "integer USING tshortfall::integer" |
|
||||||
end |
|
||||||
end |
|
||||||
|
|
||||||
def down |
|
||||||
change_table :case_logs, bulk: true do |t| |
|
||||||
t.change :reason, :string |
|
||||||
t.change :majorrepairs, :string |
|
||||||
t.change :hb, :string |
|
||||||
t.change :hbrentshortfall, :string |
|
||||||
t.change :tshortfall, :string |
|
||||||
end |
|
||||||
end |
|
||||||
end |
|
Loading…
Reference in new issue