Skip to content

Commit

Permalink
fix code search
Browse files Browse the repository at this point in the history
  • Loading branch information
javstash authored Jan 18, 2025
1 parent 9517d12 commit 79b8881
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/database/migrations/postgres-ja/2_ja_bigm_textsearch.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SET
scene_title = NEW.title,
scene_date = NEW.date,
studio_name = SUBQUERY.studio_name,
scene_code = NEW.code
scene_code = NEW.code || ' ' || REGEXP_REPLACE(NEW.code, '[-]', ' ', 'g')
FROM (
SELECT S.id as sid, T.name || ' ' || CASE WHEN TP.name IS NOT NULL THEN (TP.name) ELSE '' END AS studio_name
FROM scenes S
Expand All @@ -67,7 +67,7 @@ SELECT
NEW.title,
NEW.date,
T.name || ' ' || CASE WHEN TP.name IS NOT NULL THEN (TP.name) ELSE '' END,
NEW.code
NEW.code || ' ' || REGEXP_REPLACE(NEW.code, '[-]', ' ', 'g')
FROM studios T
LEFT JOIN studios TP ON T.parent_studio_id = TP.id
WHERE T.id = NEW.studio_id;
Expand All @@ -87,7 +87,7 @@ SELECT
S.date::TEXT AS scene_date,
T.name || ' ' || CASE WHEN TP.name IS NOT NULL THEN (TP.name) ELSE '' END AS studio_name,
ARRAY_TO_STRING(ARRAY_CAT(ARRAY_AGG(P.name), ARRAY_AGG(PS.as)), ' ', '') AS performer_names,
S.code as scene_code
S.code || ' ' || REGEXP_REPLACE(S.code, '[-]', ' ', 'g') as scene_code
FROM scenes S
LEFT JOIN scene_performers PS ON PS.scene_id = S.id
LEFT JOIN performers P ON PS.performer_id = P.id
Expand Down

0 comments on commit 79b8881

Please sign in to comment.