summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-04-15 13:06:44 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-04-28 22:28:36 +0530
commit3a609038748055a27c7e01cf4b55d8249709c9cc (patch)
treeb6ec5626549f2c423b958b8ebc3c08061388a4ca /db
parent973b948b9e9553a57113983fa4e32207b581e0ad (diff)
downloadgitlab-ce-3a609038748055a27c7e01cf4b55d8249709c9cc.tar.gz
Allow creating Personal Access Tokens through the website.
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20160415062917_create_personal_access_tokens.rb11
-rw-r--r--db/schema.rb14
2 files changed, 25 insertions, 0 deletions
diff --git a/db/migrate/20160415062917_create_personal_access_tokens.rb b/db/migrate/20160415062917_create_personal_access_tokens.rb
new file mode 100644
index 00000000000..42a41349a0c
--- /dev/null
+++ b/db/migrate/20160415062917_create_personal_access_tokens.rb
@@ -0,0 +1,11 @@
+class CreatePersonalAccessTokens < ActiveRecord::Migration
+ def change
+ create_table :personal_access_tokens do |t|
+ t.references :user, index: true, foreign_key: true, null: false
+ t.string :token, index: {unique: true}, null: false
+ t.string :name, null: false
+
+ t.timestamps null: false
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 42457d92353..05c97003971 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -704,6 +704,19 @@ ActiveRecord::Schema.define(version: 20160421130527) do
add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
+ create_table "personal_access_tokens", force: :cascade do |t|
+ t.integer "user_id", null: false
+ t.string "token", null: false
+ t.string "name", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.boolean "revoked", default: false
+ t.datetime "expires_at"
+ end
+
+ add_index "personal_access_tokens", ["token"], name: "index_personal_access_tokens_on_token", unique: true, using: :btree
+ add_index "personal_access_tokens", ["user_id"], name: "index_personal_access_tokens_on_user_id", using: :btree
+
create_table "project_group_links", force: :cascade do |t|
t.integer "project_id", null: false
t.integer "group_id", null: false
@@ -1030,4 +1043,5 @@ ActiveRecord::Schema.define(version: 20160421130527) do
add_index "web_hooks", ["created_at", "id"], name: "index_web_hooks_on_created_at_and_id", using: :btree
add_index "web_hooks", ["project_id"], name: "index_web_hooks_on_project_id", using: :btree
+ add_foreign_key "personal_access_tokens", "users"
end