From 6ba69483bde804f9760d5b9519fd3c37820ef857 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 15 Mar 2017 13:58:08 -0400 Subject: [PATCH] Revert the AddNotifiedOfOwnActivityToUsers migration --- ...t_add_notified_of_own_activity_to_users.rb | 24 +++++++++++++++++++ db/schema.rb | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb diff --git a/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb b/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb new file mode 100644 index 00000000000..b39c0a3be0f --- /dev/null +++ b/db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb @@ -0,0 +1,24 @@ +class RevertAddNotifiedOfOwnActivityToUsers < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + disable_ddl_transaction! + + DOWNTIME = false + + def up + if our_column_exists? + remove_column :users, :notified_of_own_activity + end + end + + def down + unless our_column_exists? + add_column_with_default :users, :notified_of_own_activity, :boolean, default: false + end + end + + private + + def our_column_exists? + column_exists?(:users, :notified_of_own_activity) + end +end diff --git a/db/schema.rb b/db/schema.rb index 612a86c2612..3bef910c1d6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170313133418) do +ActiveRecord::Schema.define(version: 20170315174634) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"