X-Git-Url: http://git.squeep.com/?p=squeep-indie-auther;a=blobdiff_plain;f=src%2Fdb%2Fsqlite%2Fsql%2Fprofiles-scopes-by-identifier.sql;fp=src%2Fdb%2Fsqlite%2Fsql%2Fprofiles-scopes-by-identifier.sql;h=485d043d2f602f06164404a1402b0dc27cc87a76;hp=0000000000000000000000000000000000000000;hb=b0103b0d496262c438b40bc20304081dbfe41e73;hpb=8ed81748bce7cea7904cac7225b20a60cafdfc16 diff --git a/src/db/sqlite/sql/profiles-scopes-by-identifier.sql b/src/db/sqlite/sql/profiles-scopes-by-identifier.sql new file mode 100644 index 0000000..485d043 --- /dev/null +++ b/src/db/sqlite/sql/profiles-scopes-by-identifier.sql @@ -0,0 +1,10 @@ +-- +SELECT p.profile, s.* + FROM profile p + INNER JOIN authentication a USING (identifier_id) + FULL JOIN profile_scope ps USING (profile_id) + FULL JOIN scope s USING (scope_id) + WHERE a.identifier = :identifier +UNION ALL SELECT NULL AS profile, * + FROM scope + WHERE is_manually_added OR is_permanent