From e1ccfeeb0ae515a0464f74d737a0be706ad00cc6 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Sat, 10 Aug 2024 11:30:42 +0700 Subject: [PATCH] refactor: Simplify SQL --- data/src/commonMain/sqldelight/tachiyomi/migrations/24.sqm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/data/src/commonMain/sqldelight/tachiyomi/migrations/24.sqm b/data/src/commonMain/sqldelight/tachiyomi/migrations/24.sqm index 03feb381d1..8786450ca6 100644 --- a/data/src/commonMain/sqldelight/tachiyomi/migrations/24.sqm +++ b/data/src/commonMain/sqldelight/tachiyomi/migrations/24.sqm @@ -14,10 +14,9 @@ SELECT S.* FROM ( ) AS S; -- Replace seperator from ' & ' to less common ' [.] ' -WITH tmp(_id, filtered_scanlators) AS (SELECT _id, replace(filtered_scanlators, ' & ', ' [.] ') FROM mangas) UPDATE mangas -SET filtered_scanlators = (SELECT filtered_scanlators FROM tmp) -WHERE _id IN (SELECT _id FROM tmp); +SET filtered_scanlators = replace(filtered_scanlators, ' & ', ' [.] ') +WHERE filtered_scanlators IS NOT NULL; -- To sync the project DROP VIEW IF EXISTS library_view;