summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 18:08:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-11 18:08:10 +0000
commit175b4fa261259ab0d033482d10bb4159fee8e538 (patch)
treee1f1dba5e41177f11ffded5a505e0e7f692b8df5 /db
parent4eea104c69e59f6fa53c7bc15b986c69f29b60c8 (diff)
downloadgitlab-ce-175b4fa261259ab0d033482d10bb4159fee8e538.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb13
-rw-r--r--db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb17
-rw-r--r--db/schema.rb4
3 files changed, 33 insertions, 1 deletions
diff --git a/db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb b/db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb
new file mode 100644
index 00000000000..1bc87357f7d
--- /dev/null
+++ b/db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddFingerprintSha256ToKey < ActiveRecord::Migration[5.0]
+ DOWNTIME = false
+
+ def up
+ add_column(:keys, :fingerprint_sha256, :binary)
+ end
+
+ def down
+ remove_column(:keys, :fingerprint_sha256) if column_exists?(:keys, :fingerprint_sha256)
+ end
+end
diff --git a/db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb b/db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb
new file mode 100644
index 00000000000..6f0c4bcd321
--- /dev/null
+++ b/db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFingerprintSha256IndexToKey < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:keys, "fingerprint_sha256")
+ end
+
+ def down
+ remove_concurrent_index(:keys, "fingerprint_sha256")
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index deebbcb430d..c677944bad6 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_12_06_122926) do
+ActiveRecord::Schema.define(version: 2019_12_08_071112) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
@@ -2206,7 +2206,9 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
t.string "fingerprint"
t.boolean "public", default: false, null: false
t.datetime "last_used_at"
+ t.binary "fingerprint_sha256"
t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: true
+ t.index ["fingerprint_sha256"], name: "index_keys_on_fingerprint_sha256"
t.index ["id", "type"], name: "index_on_deploy_keys_id_and_type_and_public", unique: true, where: "(public = true)"
t.index ["user_id"], name: "index_keys_on_user_id"
end