diff options
author | Markus Koller <markus-koller@gmx.ch> | 2016-12-09 18:36:50 +0100 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-03-07 14:54:35 +0100 |
commit | c4982890489d254da2fe998aab30bf257767ed5e (patch) | |
tree | 0828e0cab70cabaceffcc0d588db32ac38ddf310 /db/migrate | |
parent | fb4a486605e10692b5577f0700fbce38bebcc311 (diff) | |
download | gitlab-ce-c4982890489d254da2fe998aab30bf257767ed5e.tar.gz |
Implement OpenID Connect identity provider
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb b/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb new file mode 100644 index 00000000000..e63d5927f86 --- /dev/null +++ b/db/migrate/20161209165216_create_doorkeeper_openid_connect_tables.rb @@ -0,0 +1,37 @@ +class CreateDoorkeeperOpenidConnectTables < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + create_table :oauth_openid_requests do |t| + t.integer :access_grant_id, null: false + t.string :nonce, null: false + end + + if Gitlab::Database.postgresql? + # add foreign key without validation to avoid downtime on PostgreSQL, + # also see db/post_migrate/20170209140523_validate_foreign_keys_on_oauth_openid_requests.rb + execute %q{ + ALTER TABLE "oauth_openid_requests" + ADD CONSTRAINT "fk_oauth_openid_requests_oauth_access_grants_access_grant_id" + FOREIGN KEY ("access_grant_id") + REFERENCES "oauth_access_grants" ("id") + NOT VALID; + } + else + execute %q{ + ALTER TABLE oauth_openid_requests + ADD CONSTRAINT fk_oauth_openid_requests_oauth_access_grants_access_grant_id + FOREIGN KEY (access_grant_id) + REFERENCES oauth_access_grants (id); + } + end + end + + def down + drop_table :oauth_openid_requests + end +end |