diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-02-06 17:37:05 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-02-24 16:50:20 +0530 |
commit | 8e684809765fa866a125c176327825ebc565f5b3 (patch) | |
tree | 2086025a88fbdefbb355061eaf468e1db593adc9 /db/migrate | |
parent | 53c34c7436112d7cac9c3887ada1d5ae630a206c (diff) | |
download | gitlab-ce-8e684809765fa866a125c176327825ebc565f5b3.tar.gz |
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/migrate')
-rw-r--r-- | db/migrate/20170206115204_add_column_ghost_to_users.rb | 15 |
1 files changed, 15 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 |