refactor(recents): Migrate getRecentChapters to SQLDelight

This commit is contained in:
Ahmad Ansori Palembani 2024-08-16 19:46:14 +07:00
parent eb8727afcf
commit a6ef46a90f
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
10 changed files with 139 additions and 31 deletions

View file

@ -34,7 +34,6 @@ AND (
getRecents:
SELECT
M.url AS mangaUrl,
M.*,
C.*
FROM mangas AS M
@ -54,7 +53,6 @@ LIMIT :limit OFFSET :offset;
getRecentsUngrouped:
SELECT
M.url AS mangaUrl,
M.*,
C.*,
H.*

View file

@ -1,10 +1,8 @@
import kotlin.Long;
CREATE TABLE history(
history_id INTEGER NOT NULL PRIMARY KEY,
history_chapter_id INTEGER NOT NULL UNIQUE,
history_last_read INTEGER AS Long,
history_time_read INTEGER AS Long,
history_last_read INTEGER,
history_time_read INTEGER,
FOREIGN KEY(history_chapter_id) REFERENCES chapters (_id)
ON DELETE CASCADE
);