summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKrasimir Angelov <kangelov@gitlab.com>2019-07-02 18:56:48 +0000
committerMayra Cabrera <mcabrera@gitlab.com>2019-07-02 18:56:48 +0000
commitd745ff0431130a760a7a59899c26410dc887f77a (patch)
tree8f12c60eaad6a5eb897be9cd03d048e971218511 /db
parent4b050fc283fcc0f703d219a54dab4a02f10e475d (diff)
downloadgitlab-ce-d745ff0431130a760a7a59899c26410dc887f77a.tar.gz
Add username to deploy tokens
This new attribute is optional and used when set instead of the default format `gitlab+deploy-token-#{id}`. Empty usernames will be saved as null in the database. Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/50228.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190613044655_add_username_to_deploy_tokens.rb9
-rw-r--r--db/schema.rb1
2 files changed, 10 insertions, 0 deletions
diff --git a/db/migrate/20190613044655_add_username_to_deploy_tokens.rb b/db/migrate/20190613044655_add_username_to_deploy_tokens.rb
new file mode 100644
index 00000000000..793553afe35
--- /dev/null
+++ b/db/migrate/20190613044655_add_username_to_deploy_tokens.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddUsernameToDeployTokens < ActiveRecord::Migration[5.1]
+ DOWNTIME = false
+
+ def change
+ add_column :deploy_tokens, :username, :string
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 7948f919c57..143f6c7127e 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1047,6 +1047,7 @@ ActiveRecord::Schema.define(version: 20190628145246) do
t.datetime_with_timezone "created_at", null: false
t.string "name", null: false
t.string "token", null: false
+ t.string "username"
t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)", using: :btree
t.index ["token"], name: "index_deploy_tokens_on_token", unique: true, using: :btree
end