From 111dc4ea9d481cfd27263ab7bbc45f83a1789b68 Mon Sep 17 00:00:00 2001 From: Molly Struve Date: Fri, 11 Sep 2020 01:49:27 -0500 Subject: [PATCH] [deploy] Bug Fix: Add New Migration to Remove Active from Profile Fields (#10279) --- ...0910205316_remove_active_from_profile_fields2.rb | 13 +++++++++++++ db/schema.rb | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20200910205316_remove_active_from_profile_fields2.rb diff --git a/db/migrate/20200910205316_remove_active_from_profile_fields2.rb b/db/migrate/20200910205316_remove_active_from_profile_fields2.rb new file mode 100644 index 000000000..a8e98d327 --- /dev/null +++ b/db/migrate/20200910205316_remove_active_from_profile_fields2.rb @@ -0,0 +1,13 @@ +class RemoveActiveFromProfileFields2 < ActiveRecord::Migration[6.0] + def up + return unless column_exists?(:profile_fields, :active) + + safety_assured { remove_column :profile_fields, :active } + end + + def down + return if column_exists?(:profile_fields, :active) + + add_column :profile_fields, :active, :boolean + end +end diff --git a/db/schema.rb b/db/schema.rb index 9b739972a..adc1103cc 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: 2020_09_04_151734) do +ActiveRecord::Schema.define(version: 2020_09_10_205316) do # These are extensions that must be enabled in order to support this database enable_extension "citext"