Added rudimentary release search.

This commit is contained in:
2020-02-26 01:15:50 +01:00
parent 756ab09ce6
commit 638a71f36c
20 changed files with 356 additions and 58 deletions

View File

@@ -0,0 +1,14 @@
exports.up = knex => Promise.resolve()
.then(() => knex.raw(`
CREATE FUNCTION search_releases(search text) RETURNS SETOF releases AS $$
SELECT * FROM releases
WHERE
title ILIKE ('%' || search || '%') OR
url ILIKE ('%' || search || '%')
$$ LANGUAGE SQL STABLE;
`));
exports.down = knex => Promise.resolve()
.then(() => knex.raw(`
DROP FUNCTION IF EXISTS search_releases;
`));