diff options
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| |