20170613154149_create_gpg_signatures.rb 720 Bytes
Newer Older
1
class CreateGpgSignatures < ActiveRecord::Migration[4.2]
2 3
  include Gitlab::Database::MigrationHelpers

4 5
  DOWNTIME = false

6
  def change
7
    create_table :gpg_signatures do |t|
8 9
      t.timestamps_with_timezone null: false

10 11
      t.references :project, index: true, foreign_key: { on_delete: :cascade }
      t.references :gpg_key, index: true, foreign_key: { on_delete: :nullify }
12

13
      t.boolean :valid_signature
14

15 16
      t.binary :commit_sha
      t.binary :gpg_key_primary_keyid
17

18 19
      t.text :gpg_key_user_name
      t.text :gpg_key_user_email
20

21 22
      t.index :commit_sha, unique: true, length: mysql_compatible_index_length
      t.index :gpg_key_primary_keyid, length: mysql_compatible_index_length
23
    end
24 25
  end
end