BigW Consortium Gitlab

20170613154149_create_gpg_signatures.rb 679 Bytes
Newer Older
1 2 3
class CreateGpgSignatures < ActiveRecord::Migration
  DOWNTIME = false

4
  def change
5
    create_table :gpg_signatures do |t|
6 7
      t.timestamps_with_timezone null: false

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

11
      t.boolean :valid_signature
12

13 14
      t.binary :commit_sha
      t.binary :gpg_key_primary_keyid
15

16 17
      t.text :gpg_key_user_name
      t.text :gpg_key_user_email
18

19
      t.index :commit_sha, unique: true, length: Gitlab::Database.mysql? ? 20 : nil
20
      t.index :gpg_key_primary_keyid, length: Gitlab::Database.mysql? ? 20 : nil
21
    end
22 23
  end
end