refactor(db): Migrate mangaCategory queries (that can be migrated) to SQLDelight

This commit is contained in:
Ahmad Ansori Palembani 2024-11-29 19:11:29 +07:00
parent 726613e6d7
commit e8054855ac
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
10 changed files with 71 additions and 24 deletions

View file

@ -7,3 +7,15 @@ CREATE TABLE mangas_categories(
FOREIGN KEY(manga_id) REFERENCES mangas (_id)
ON DELETE CASCADE
);
delete:
DELETE FROM mangas_categories
WHERE manga_id = :mangaId;
deleteBulk:
DELETE FROM mangas_categories
WHERE manga_id IN :mangaIds;
insert:
INSERT INTO mangas_categories(manga_id, category_id)
VALUES (:mangaId, :categoryId);