diff options
-rw-r--r-- | gentoobrowse-api/service/sql/maintenance/ebuildUsesInsert.sql | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gentoobrowse-api/service/sql/maintenance/ebuildUsesInsert.sql b/gentoobrowse-api/service/sql/maintenance/ebuildUsesInsert.sql index b6f822e..2def689 100644 --- a/gentoobrowse-api/service/sql/maintenance/ebuildUsesInsert.sql +++ b/gentoobrowse-api/service/sql/maintenance/ebuildUsesInsert.sql @@ -1,5 +1,9 @@ INSERT INTO tmpEbuildUses(ebuildId, use, defaultflag) -SELECT DISTINCT ?::INT, +SELECT ?::INT, LTRIM(r, '-+'), - CASE WHEN LEFT(r, 1) = '-' THEN FALSE WHEN LEFT(r, 1) = '+' THEN TRUE END + CASE + WHEN MIN(LEFT(r, 1)) = '+' THEN TRUE + WHEN MIN(LEFT(r, 1)) = '-' THEN FALSE + END FROM REGEXP_SPLIT_TO_TABLE(?, '\s+') r +GROUP BY LTRIM(r, '-+') |