summaryrefslogtreecommitdiff
path: root/db/post_migrate/20171012150314_remove_user_authentication_token.rb
blob: d0f3aa06e982773ccc9d24815b53312c77db41a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

class RemoveUserAuthenticationToken < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    remove_column :users, :authentication_token
  end

  def down
    add_column :users, :authentication_token, :string

    add_concurrent_index :users, :authentication_token, unique: true
  end
end