Changed showcased query.
This commit is contained in:
parent
b6559331eb
commit
67f5ea9de8
|
@ -1,16 +1,16 @@
|
||||||
exports.up = async (knex) => knex.raw(`
|
exports.up = async (knex) => knex.raw(`
|
||||||
/* CREATE FUNCTION releases_is_showcased(release releases) RETURNS BOOLEAN AS $$
|
CREATE FUNCTION releases_is_showcased(release releases) RETURNS BOOLEAN AS $$
|
||||||
SELECT COALESCE(entities.showcased, false) OR COALESCE(studios.showcased, false) FROM releases
|
SELECT COALESCE(entities.showcased, false) OR COALESCE(studios.showcased, false) FROM releases
|
||||||
LEFT JOIN entities ON entities.id = releases.entity_id
|
LEFT JOIN entities ON entities.id = releases.entity_id
|
||||||
LEFT JOIN entities AS studios ON studios.id = releases.studio_id
|
LEFT JOIN entities AS studios ON studios.id = releases.studio_id
|
||||||
WHERE releases.id = release.id
|
WHERE releases.id = release.id
|
||||||
$$ LANGUAGE SQL STABLE; */
|
$$ LANGUAGE SQL STABLE;
|
||||||
|
|
||||||
CREATE FUNCTION releases_is_showcased(release releases) RETURNS BOOLEAN AS $$
|
/* CREATE FUNCTION releases_is_showcased(release releases) RETURNS BOOLEAN AS $$
|
||||||
SELECT COALESCE((SELECT showcased FROM entities WHERE entities.id = releases.entity_id), false)
|
SELECT COALESCE((SELECT showcased FROM entities WHERE entities.id = releases.entity_id), false)
|
||||||
OR COALESCE((SELECT showcased FROM entities WHERE entities.id = releases.studio_id), false) FROM releases
|
OR COALESCE((SELECT showcased FROM entities WHERE entities.id = releases.studio_id), false) FROM releases
|
||||||
WHERE releases.id = release.id
|
WHERE releases.id = release.id
|
||||||
$$ LANGUAGE SQL STABLE;
|
$$ LANGUAGE SQL STABLE; */
|
||||||
`);
|
`);
|
||||||
|
|
||||||
exports.down = async (knex) => knex.raw(`
|
exports.down = async (knex) => knex.raw(`
|
||||||
|
|
Loading…
Reference in New Issue