From 67f5ea9de8efbfcf9d456db4f47b84b561b34b60 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 4 Jan 2023 02:48:37 +0100 Subject: [PATCH] Changed showcased query. --- migrations/20230104014437_release_showcased.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/migrations/20230104014437_release_showcased.js b/migrations/20230104014437_release_showcased.js index 58305b2b..18e50618 100644 --- a/migrations/20230104014437_release_showcased.js +++ b/migrations/20230104014437_release_showcased.js @@ -1,16 +1,16 @@ 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 LEFT JOIN entities ON entities.id = releases.entity_id LEFT JOIN entities AS studios ON studios.id = releases.studio_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) OR COALESCE((SELECT showcased FROM entities WHERE entities.id = releases.studio_id), false) FROM releases WHERE releases.id = release.id - $$ LANGUAGE SQL STABLE; + $$ LANGUAGE SQL STABLE; */ `); exports.down = async (knex) => knex.raw(`