Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-07-20 16:44:15 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:46:03 +0300
commit8e0c33ed1337e3614fe87d9d0c1eb64af90cc61a (patch)
treee41eff2b3d647de4062147b233e35719f2fa92e2 /db
parent8c8a9e6d3fcb529e95d76dc9a7d4e37542a2036f (diff)
use ShaAttribute for gpg table columns
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170222111732_create_gpg_keys.rb4
-rw-r--r--db/migrate/20170613154149_create_gpg_signatures.rb5
-rw-r--r--db/migrate/limits_to_mysql.rb4
-rw-r--r--db/schema.rb8
4 files changed, 13 insertions, 8 deletions
diff --git a/db/migrate/20170222111732_create_gpg_keys.rb b/db/migrate/20170222111732_create_gpg_keys.rb
index 55dc730e884..7591238311f 100644
--- a/db/migrate/20170222111732_create_gpg_keys.rb
+++ b/db/migrate/20170222111732_create_gpg_keys.rb
@@ -7,8 +7,8 @@ class CreateGpgKeys < ActiveRecord::Migration
t.references :user, index: true, foreign_key: true
- t.string :fingerprint
- t.string :primary_keyid
+ t.binary :primary_keyid, limit: Gitlab::Database.mysql? ? 20 : nil
+ t.binary :fingerprint, limit: Gitlab::Database.mysql? ? 20 : nil
t.text :key
diff --git a/db/migrate/20170613154149_create_gpg_signatures.rb b/db/migrate/20170613154149_create_gpg_signatures.rb
index 515c1413cf4..c5478551e11 100644
--- a/db/migrate/20170613154149_create_gpg_signatures.rb
+++ b/db/migrate/20170613154149_create_gpg_signatures.rb
@@ -10,8 +10,9 @@ class CreateGpgSignatures < ActiveRecord::Migration
t.boolean :valid_signature
- t.string :commit_sha
- t.string :gpg_key_primary_keyid
+ t.binary :commit_sha, limit: Gitlab::Database.mysql? ? 20 : nil
+ t.binary :gpg_key_primary_keyid, limit: Gitlab::Database.mysql? ? 20 : nil
+
t.string :gpg_key_user_name
t.string :gpg_key_user_email
diff --git a/db/migrate/limits_to_mysql.rb b/db/migrate/limits_to_mysql.rb
index be3501c4c2e..de1288e6410 100644
--- a/db/migrate/limits_to_mysql.rb
+++ b/db/migrate/limits_to_mysql.rb
@@ -8,5 +8,9 @@ class LimitsToMysql < ActiveRecord::Migration
change_column :snippets, :content, :text, limit: 2147483647
change_column :notes, :st_diff, :text, limit: 2147483647
change_column :events, :data, :text, limit: 2147483647
+ change_column :gpg_keys, :primary_keyid, :binary, limit: 20
+ change_column :gpg_keys, :fingerprint, :binary, limit: 20
+ change_column :gpg_signatures, :commit_sha, :binary, limit: 20
+ change_column :gpg_signatures, :gpg_key_primary_keyid, :binary, limit: 20
end
end
diff --git a/db/schema.rb b/db/schema.rb
index f413aaa41cd..68b5963ec14 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -544,8 +544,8 @@ ActiveRecord::Schema.define(version: 20170725145659) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "user_id"
- t.string "fingerprint"
- t.string "primary_keyid"
+ t.binary "primary_keyid"
+ t.binary "fingerprint"
t.text "key"
end
@@ -558,8 +558,8 @@ ActiveRecord::Schema.define(version: 20170725145659) do
t.integer "project_id"
t.integer "gpg_key_id"
t.boolean "valid_signature"
- t.string "commit_sha"
- t.string "gpg_key_primary_keyid"
+ t.binary "commit_sha"
+ t.binary "gpg_key_primary_keyid"
t.string "gpg_key_user_name"
t.string "gpg_key_user_email"
end