mirror of
https://github.com/null2264/yokai.git
synced 2025-06-20 18:24:42 +00:00
refactor(db): Migrate GetTrack to SQLDelight
This commit is contained in:
parent
e9a68f661f
commit
c183802096
26 changed files with 154 additions and 48 deletions
|
@ -10,3 +10,8 @@ findAll:
|
|||
SELECT *
|
||||
FROM categories
|
||||
ORDER BY sort;
|
||||
|
||||
findAllByMangaId:
|
||||
SELECT categories.* FROM categories
|
||||
JOIN mangas_categories ON categories._id = mangas_categories.category_id
|
||||
WHERE mangas_categories.manga_id = :mangaId;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import kotlin.Float;
|
||||
import kotlin.Long;
|
||||
|
||||
CREATE TABLE manga_sync(
|
||||
_id INTEGER NOT NULL PRIMARY KEY,
|
||||
|
@ -11,11 +10,16 @@ CREATE TABLE manga_sync(
|
|||
last_chapter_read REAL NOT NULL,
|
||||
total_chapters INTEGER NOT NULL,
|
||||
status INTEGER NOT NULL,
|
||||
score REAL AS Float NOT NULL,
|
||||
score REAL NOT NULL,
|
||||
remote_url TEXT NOT NULL,
|
||||
start_date INTEGER AS Long NOT NULL,
|
||||
finish_date INTEGER AS Long NOT NULL,
|
||||
start_date INTEGER NOT NULL,
|
||||
finish_date INTEGER NOT NULL,
|
||||
UNIQUE (manga_id, sync_id) ON CONFLICT REPLACE,
|
||||
FOREIGN KEY(manga_id) REFERENCES mangas (_id)
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
|
||||
getAllByMangaId:
|
||||
SELECT *
|
||||
FROM manga_sync
|
||||
WHERE manga_id = :mangaId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue