Browse Source

put migrations into one file

pull/95/head
magicmilo 3 years ago
parent
commit
4eed52dc0d
  1. 11
      db/migrate/20211119104835_add_property_info_fields.rb
  2. 7
      db/migrate/20211119142809_change_renewal.rb
  3. 21
      db/migrate/20211119154133_change_column_types.rb
  4. 2
      db/schema.rb

11
db/migrate/20211119104835_add_property_info_fields.rb

@ -1,12 +1,13 @@
class AddPropertyInfoFields < ActiveRecord::Migration[6.1] class AddPropertyInfoFields < ActiveRecord::Migration[6.1]
def change def change
change_table :case_logs, bulk: true do |t| change_table :case_logs, bulk: true do |t|
t.column :do_you_know_the_postcode, :integer t.column :do_you_know_the_postcode, :string
t.column :do_you_know_the_local_authority, :integer t.column :do_you_know_the_local_authority, :string
t.column :why_dont_you_know_la, :string t.column :why_dont_you_know_la, :string
t.column :first_time_property_let_as_social_housing, :integer t.column :first_time_property_let_as_social_housing, :string
t.column :type_property_most_recently_let_as, :integer t.column :type_property_most_recently_let_as, :string
t.column :builtype, :integer t.column :builtype, :string
t.rename :tenant_same_property_renewal, :renewal
end end
end end
end end

7
db/migrate/20211119142809_change_renewal.rb

@ -1,7 +0,0 @@
class ChangeRenewal < ActiveRecord::Migration[6.1]
def change
rename_column :case_logs, :tenant_same_property_renewal, :renewal
end
end

21
db/migrate/20211119154133_change_column_types.rb

@ -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

2
db/schema.rb

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"

Loading…
Cancel
Save