diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-02-06 15:07:05 +0300 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-02-24 14:20:20 +0300 |
commit | 8e684809765fa866a125c176327825ebc565f5b3 (patch) | |
tree | 2086025a88fbdefbb355061eaf468e1db593adc9 /db | |
parent | 53c34c7436112d7cac9c3887ada1d5ae630a206c (diff) |
Use a `ghost` boolean to track ghost users.
Rather than using a separate `ghost` state. This lets us have the benefits of
both ghost and blocked users (ghost: true, state: blocked) without having to
rewrite a number of queries to include cases for `state: ghost`.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170206115204_add_column_ghost_to_users.rb | 15 | ||||
-rw-r--r-- | db/schema.rb | 1 |
2 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20170206115204_add_column_ghost_to_users.rb b/db/migrate/20170206115204_add_column_ghost_to_users.rb new file mode 100644 index 00000000000..57b66ca91a8 --- /dev/null +++ b/db/migrate/20170206115204_add_column_ghost_to_users.rb @@ -0,0 +1,15 @@ +class AddColumnGhostToUsers < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default :users, :ghost, :boolean, default: false, allow_null: false + end + + def down + remove_column :users, :ghost + end +end diff --git a/db/schema.rb b/db/schema.rb index 82bccda580a..c50d6fc4ad6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1282,6 +1282,7 @@ ActiveRecord::Schema.define(version: 20170216141440) do t.string "incoming_email_token" t.boolean "authorized_projects_populated" t.boolean "notified_of_own_activity", default: false, null: false + t.boolean "ghost", default: false, null: false end add_index "users", ["admin"], name: "index_users_on_admin", using: :btree |