Show failed migrations instead of waiting on them forever
This commit is contained in:
@@ -4,6 +4,19 @@ import kotlin.String;
|
||||
import kotlin.collections.List;
|
||||
import kotlinx.serialization.json.JsonObject;
|
||||
|
||||
-- ---------------------------------------------------------------------------------------------------------
|
||||
-- orphans
|
||||
-- ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
-- Rows pointing at an entry, chapter or category that no longer exists were written while foreign keys weren't
|
||||
-- enforced. Nothing can reach them, and copied over they'd fail the foreign key check that ends the migration.
|
||||
DELETE FROM chapters WHERE manga_id NOT IN (SELECT _id FROM mangas);
|
||||
DELETE FROM history WHERE chapter_id NOT IN (SELECT _id FROM chapters);
|
||||
DELETE FROM mangas_categories
|
||||
WHERE manga_id NOT IN (SELECT _id FROM mangas) OR category_id NOT IN (SELECT _id FROM categories);
|
||||
DELETE FROM manga_sync WHERE manga_id NOT IN (SELECT _id FROM mangas);
|
||||
DELETE FROM excluded_scanlators WHERE manga_id NOT IN (SELECT _id FROM mangas);
|
||||
|
||||
-- ---------------------------------------------------------------------------------------------------------
|
||||
-- table - manga
|
||||
-- ---------------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user