2017-06-14 03:17:34 -04:00
|
|
|
class CreateGpgSignatures < ActiveRecord::Migration
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2017-07-15 09:25:21 -04:00
|
|
|
def change
|
2017-06-14 03:17:34 -04:00
|
|
|
create_table :gpg_signatures do |t|
|
2017-07-15 09:25:21 -04:00
|
|
|
t.timestamps_with_timezone null: false
|
|
|
|
|
2017-07-20 10:33:44 -04:00
|
|
|
t.references :project, index: true, foreign_key: { on_delete: :cascade }
|
|
|
|
t.references :gpg_key, index: true, foreign_key: { on_delete: :nullify }
|
2017-06-14 03:17:34 -04:00
|
|
|
|
2017-07-15 09:25:21 -04:00
|
|
|
t.boolean :valid_signature
|
2017-06-14 03:17:34 -04:00
|
|
|
|
2017-07-20 16:07:04 -04:00
|
|
|
t.binary :commit_sha
|
|
|
|
t.binary :gpg_key_primary_keyid
|
2017-07-20 09:44:15 -04:00
|
|
|
|
2017-07-20 10:11:53 -04:00
|
|
|
t.text :gpg_key_user_name
|
|
|
|
t.text :gpg_key_user_email
|
2017-06-14 03:17:34 -04:00
|
|
|
|
2017-07-26 03:30:33 -04:00
|
|
|
t.index :commit_sha, unique: true, length: Gitlab::Database.mysql? ? 20 : nil
|
2017-07-20 16:07:04 -04:00
|
|
|
t.index :gpg_key_primary_keyid, length: Gitlab::Database.mysql? ? 20 : nil
|
2017-07-15 09:25:21 -04:00
|
|
|
end
|
2017-06-14 03:17:34 -04:00
|
|
|
end
|
|
|
|
end
|