2018-11-13 02:27:31 -05:00
|
|
|
class CreateGpgSignatures < ActiveRecord::Migration[4.2]
|
2018-09-21 06:23:29 -04:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
2017-06-14 03:17:34 -04:00
|
|
|
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
|
|
|
|
2018-09-21 06:23:29 -04: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 09:25:21 -04:00
|
|
|
end
|
2017-06-14 03:17:34 -04:00
|
|
|
end
|
|
|
|
end
|