2018-11-13 07:27:31 +00:00
|
|
|
class CreateGpgSignatures < ActiveRecord::Migration[4.2]
|
2018-09-21 10:23:29 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
2017-06-14 07:17:34 +00:00
|
|
|
DOWNTIME = false
|
|
|
|
|
2017-07-15 13:25:21 +00:00
|
|
|
def change
|
2017-06-14 07:17:34 +00:00
|
|
|
create_table :gpg_signatures do |t|
|
2017-07-15 13:25:21 +00:00
|
|
|
t.timestamps_with_timezone null: false
|
|
|
|
|
2017-07-20 14:33:44 +00: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 07:17:34 +00:00
|
|
|
|
2017-07-15 13:25:21 +00:00
|
|
|
t.boolean :valid_signature
|
2017-06-14 07:17:34 +00:00
|
|
|
|
2017-07-20 20:07:04 +00:00
|
|
|
t.binary :commit_sha
|
|
|
|
t.binary :gpg_key_primary_keyid
|
2017-07-20 13:44:15 +00:00
|
|
|
|
2017-07-20 14:11:53 +00:00
|
|
|
t.text :gpg_key_user_name
|
|
|
|
t.text :gpg_key_user_email
|
2017-06-14 07:17:34 +00:00
|
|
|
|
2018-09-21 10:23:29 +00:00
|
|
|
t.index :commit_sha, unique: true, length: mysql_compatible_index_length
|
|
|
|
t.index :gpg_key_primary_keyid, length: mysql_compatible_index_length
|
2017-07-15 13:25:21 +00:00
|
|
|
end
|
2017-06-14 07:17:34 +00:00
|
|
|
end
|
|
|
|
end
|