diff options
author | Robert Speicher <robert@gitlab.com> | 2017-03-16 01:51:03 +0300 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2017-03-16 01:57:10 +0300 |
commit | e2a0ea3d23693c5b4f076740dc1429ac883ebfa8 (patch) | |
tree | 400c3dafe6e06f30978d59c871717a5fc3320dc1 | |
parent | 16bcc55046f58876501a4545ac41e3c621317773 (diff) |
Merge branch 'rs-revert-notified-of-own-activity-migration' into 'master'
Revert the AddNotifiedOfOwnActivityToUsers migration
See merge request !9973
-rw-r--r-- | db/migrate/20170315174634_revert_add_notified_of_own_activity_to_users.rb | 24 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 25 insertions, 1 deletions
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 2d161e3ce88..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: 20170306170512) do +ActiveRecord::Schema.define(version: 20170315174634) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" |