summaryrefslogtreecommitdiff
path: root/db/migrate/20191112212815_create_web_authn_table.rb
blob: 72895f955df54ff4dfa0ed459206faccfbd56574 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# frozen_string_literal: true

class CreateWebAuthnTable < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  # disable_ddl_transaction!

  # rubocop:disable Migration/AddLimitToTextColumns
  # limits are added in subsequent migration
  def change
    create_table :webauthn_registrations do |t|
      t.bigint :user_id, null: false, index: true

      t.bigint :counter, default: 0, null: false
      t.timestamps_with_timezone
      t.text :credential_xid, null: false, index: { unique: true }
      t.text :name, null: false
      # The length of the public key is determined by the device
      # and not specified. Thus we can't set a limit
      t.text :public_key, null: false # rubocop:disable Migration/AddLimitToTextColumns
    end
  end
  # rubocop:enable Migration/AddLimitToTextColumns
end