diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-06-13 14:46:43 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:42:53 +0300 |
commit | 3c42d730986222d891c9b7985edf3942021afcef (patch) | |
tree | 4631a62e7cbfba445e8cf6b89f9b5e6582aa4cc3 /db | |
parent | 7e13d96715750f74db399bf40ee4ec9679bbe806 (diff) |
add primary keyid attribute to gpg keys
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170613103429_add_primary_keyid_to_gpg_keys.rb | 17 | ||||
-rw-r--r-- | db/schema.rb | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20170613103429_add_primary_keyid_to_gpg_keys.rb b/db/migrate/20170613103429_add_primary_keyid_to_gpg_keys.rb new file mode 100644 index 00000000000..13f0500971b --- /dev/null +++ b/db/migrate/20170613103429_add_primary_keyid_to_gpg_keys.rb @@ -0,0 +1,17 @@ +class AddPrimaryKeyidToGpgKeys < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column :gpg_keys, :primary_keyid, :string + add_concurrent_index :gpg_keys, :primary_keyid + end + + def down + remove_concurrent_index :gpg_keys, :primary_keyid if index_exists?(:gpg_keys, :primary_keyid) + remove_column :gpg_keys, :primary_keyid, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 54f98559243..fbf20f4eb66 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -546,8 +546,10 @@ ActiveRecord::Schema.define(version: 20170725145659) do t.integer "user_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "primary_keyid" end + add_index "gpg_keys", ["primary_keyid"], name: "index_gpg_keys_on_primary_keyid", using: :btree add_index "gpg_keys", ["user_id"], name: "index_gpg_keys_on_user_id", using: :btree create_table "identities", force: :cascade do |t| |