diff options
author | Stan Hu <stanhu@gmail.com> | 2017-03-25 01:06:36 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-03-25 01:06:36 +0300 |
commit | da74e97c894fa0ef24e520a2cfca92335bba5a99 (patch) | |
tree | ed2323ed061c5a7280b9796503d5644124071103 /db | |
parent | e1bb8c99cf7840c8b5d981111857b7d16b9cc1bd (diff) |
Use default_value_for to set notified_of_own_activity instead of using a DB migration
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170317131326_add_notified_of_own_activity_default.rb | 20 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 1 insertions, 21 deletions
diff --git a/db/post_migrate/20170317131326_add_notified_of_own_activity_default.rb b/db/post_migrate/20170317131326_add_notified_of_own_activity_default.rb deleted file mode 100644 index f01ef6b4119..00000000000 --- a/db/post_migrate/20170317131326_add_notified_of_own_activity_default.rb +++ /dev/null @@ -1,20 +0,0 @@ -class AddNotifiedOfOwnActivityDefault < ActiveRecord::Migration - include Gitlab::Database::MigrationHelpers - disable_ddl_transaction! - - DOWNTIME = false - - def up - begin - update_column_in_batches(:users, :notified_of_own_activity, false) do |table, query| - query.where(table[:notified_of_own_activity].eq(nil)) - end - - change_column :users, :notified_of_own_activity, :boolean, default: false, null: false - end - end - - def down - change_column_default :users, :notified_of_own_activity, nil - end -end diff --git a/db/schema.rb b/db/schema.rb index 47833b7e518..f476637ceb2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1236,7 +1236,7 @@ ActiveRecord::Schema.define(version: 20170317203554) do t.string "organization" t.boolean "authorized_projects_populated" t.boolean "ghost" - t.boolean "notified_of_own_activity", default: false, null: false + t.boolean "notified_of_own_activity" end add_index "users", ["admin"], name: "index_users_on_admin", using: :btree |