From 4eed52dc0d58f955f7e908bce4daf6e5c7655923 Mon Sep 17 00:00:00 2001 From: magicmilo Date: Wed, 24 Nov 2021 11:05:51 +0000 Subject: [PATCH] put migrations into one file --- ...20211119104835_add_property_info_fields.rb | 11 +++++----- db/migrate/20211119142809_change_renewal.rb | 7 ------- .../20211119154133_change_column_types.rb | 21 ------------------- db/schema.rb | 2 +- 4 files changed, 7 insertions(+), 34 deletions(-) delete mode 100644 db/migrate/20211119142809_change_renewal.rb delete mode 100644 db/migrate/20211119154133_change_column_types.rb diff --git a/db/migrate/20211119104835_add_property_info_fields.rb b/db/migrate/20211119104835_add_property_info_fields.rb index 78362fe2a..98d8b4b71 100644 --- a/db/migrate/20211119104835_add_property_info_fields.rb +++ b/db/migrate/20211119104835_add_property_info_fields.rb @@ -1,12 +1,13 @@ class AddPropertyInfoFields < ActiveRecord::Migration[6.1] def change change_table :case_logs, bulk: true do |t| - t.column :do_you_know_the_postcode, :integer - t.column :do_you_know_the_local_authority, :integer + t.column :do_you_know_the_postcode, :string + t.column :do_you_know_the_local_authority, :string t.column :why_dont_you_know_la, :string - t.column :first_time_property_let_as_social_housing, :integer - t.column :type_property_most_recently_let_as, :integer - t.column :builtype, :integer + t.column :first_time_property_let_as_social_housing, :string + t.column :type_property_most_recently_let_as, :string + t.column :builtype, :string + t.rename :tenant_same_property_renewal, :renewal end end end diff --git a/db/migrate/20211119142809_change_renewal.rb b/db/migrate/20211119142809_change_renewal.rb deleted file mode 100644 index f8c244600..000000000 --- a/db/migrate/20211119142809_change_renewal.rb +++ /dev/null @@ -1,7 +0,0 @@ -class ChangeRenewal < ActiveRecord::Migration[6.1] - def change - rename_column :case_logs, :tenant_same_property_renewal, :renewal - end -end - - diff --git a/db/migrate/20211119154133_change_column_types.rb b/db/migrate/20211119154133_change_column_types.rb deleted file mode 100644 index 75c1c05b8..000000000 --- a/db/migrate/20211119154133_change_column_types.rb +++ /dev/null @@ -1,21 +0,0 @@ -class ChangeColumnTypes < ActiveRecord::Migration[6.1] - def up - change_table :case_logs, bulk: true do |t| - t.change :first_time_property_let_as_social_housing, :string - t.change :type_property_most_recently_let_as, :string - t.change :builtype, :string - t.change :do_you_know_the_local_authority, :string - t.change :do_you_know_the_postcode, :string - end - end - - def down - change_table :case_logs, bulk: true do |t| - t.change :first_time_property_let_as_social_housing, :int - t.change :type_property_most_recently_let_as, :int - t.change :builtype, :int - t.change :do_you_know_the_local_authority, :int - t.change :do_you_know_the_postcode, :int - end - end -end diff --git a/db/schema.rb b/db/schema.rb index 5ae2fff35..d96ec5fe2 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_19_154133) do +ActiveRecord::Schema.define(version: 2021_11_19_104835) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"