Skip to content

Commit

Permalink
Merge pull request #1923 from Mashape/hotfix/oauth2-migration
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco authored Dec 23, 2016
2 parents 8e628cd + 369c88c commit 45f6b01
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions kong/plugins/oauth2/migrations/postgres.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,17 @@ return {
]]
},
{
name = "2016-04-14-283949_serialize_redirect_uri",
name = "2016-07-15-oauth2_code_credential_id",
up = [[
DELETE FROM oauth2_authorization_codes;
ALTER TABLE oauth2_authorization_codes ADD COLUMN credential_id uuid REFERENCES oauth2_credentials (id) ON DELETE CASCADE;
]],
down = [[
ALTER TABLE oauth2_authorization_codes DROP COLUMN credential_id;
]]
},
{
name = "2016-12-22-283949_serialize_redirect_uri",
up = function(_, _, factory)
local schema = factory.oauth2_credentials.schema
schema.fields.redirect_uri.type = "string"
Expand Down Expand Up @@ -116,15 +126,5 @@ return {
end
end
end
},
{
name = "2016-07-15-oauth2_code_credential_id",
up = [[
DELETE FROM oauth2_authorization_codes;
ALTER TABLE oauth2_authorization_codes ADD COLUMN credential_id uuid REFERENCES oauth2_credentials (id) ON DELETE CASCADE;
]],
down = [[
ALTER TABLE oauth2_authorization_codes DROP COLUMN credential_id;
]]
}
}

0 comments on commit 45f6b01

Please sign in to comment.