X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=blobdiff_plain;f=src%2Fdb%2Fpostgres%2Fsql%2Ftoken-scopes-remove.sql;fp=src%2Fdb%2Fpostgres%2Fsql%2Ftoken-scopes-remove.sql;h=dd667f2960f2690a6c9630995559f326bc45f808;hp=0000000000000000000000000000000000000000;hb=b0103b0d496262c438b40bc20304081dbfe41e73;hpb=8ed81748bce7cea7904cac7225b20a60cafdfc16 diff --git a/src/db/postgres/sql/token-scopes-remove.sql b/src/db/postgres/sql/token-scopes-remove.sql new file mode 100644 index 0000000..dd667f2 --- /dev/null +++ b/src/db/postgres/sql/token-scopes-remove.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM token_scope +WHERE (code_id, scope_id) IN ( + SELECT code_id, scope_id FROM token_scope ts + INNER JOIN scope s USING (scope_id) + WHERE scope = ANY($(removeScopes)) AND code_id = $(codeId) +)