diff options
Diffstat (limited to 'dbstore/sql/feed')
-rw-r--r-- | dbstore/sql/feed/insert-assigner.sql | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dbstore/sql/feed/insert-assigner.sql b/dbstore/sql/feed/insert-assigner.sql new file mode 100644 index 0000000..c21f51d --- /dev/null +++ b/dbstore/sql/feed/insert-assigner.sql @@ -0,0 +1,13 @@ +-- add assigner, unless they are already in the database +-- +-- NOTE: might be able to do this more gracefully with an UPSERT in +-- sqlite? +INSERT INTO assigners(assigner) + SELECT :assigner + + EXCEPT + + -- exclude existing assigners + SELECT assigner + FROM assigners + WHERE assigner = :assigner; |