Files
mihon-bookoasis/app/src/main/sqldelight/migrations/10.sqm
T
Andreas b1f46ed830 Migrate History screen database calls to SQLDelight (#6933)
* Migrate History screen database call to SQLDelight

- Move all migrations to SQLDelight
- Move all tables to SQLDelight

Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>

* Changes from review comments

* Add adapters to database

* Remove logging of database version in App

* Change query name for paging source queries

* Update migrations

* Make SQLite Callback handle migration

- To ensure it updates the database

* Use SQLDelight Schema version for Callback database version

Co-authored-by: inorichi <3521738+inorichi@users.noreply.github.com>
2022-04-21 15:45:56 -04:00

11 lines
221 B
Plaintext

ALTER TABLE mangas
ADD COLUMN date_added INTEGER NOT NULL DEFAULT 0;
UPDATE mangas
SET date_added = (
SELECT MIN(date_fetch)
FROM mangas M
INNER JOIN chapters C
ON M._id = C.manga_id
GROUP BY M._id
);