bump package version to 1.1.0
[squeep-indie-auther] / src / db / sqlite / sql / scope-cleanup.sql
1 -- Remove any un-used, non-permanent, non-manually-created scopes.
2 DELETE FROM scope WHERE scope_id NOT IN (
3 SELECT scope_id FROM scope s
4 INNER JOIN profile_scope ps USING (scope_id)
5 UNION ALL
6 SELECT scope_id FROM scope s
7 INNER JOIN token_scope ts USING (scope_id)
8 ) AND NOT (is_permanent OR is_manually_added)