From 204ba71a656dedd2da0840eef53dc83e55f989e4 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 1 May 2022 16:27:01 +0200 Subject: [PATCH] Fix migrations (#7051) (cherry picked from commit 609f552c8d2b3a33473322a268ba61edf4eba94d) # Conflicts: # app/src/main/sqldelight/migrations/12.sqm --- app/src/main/sqldelight/migrations/8.sqm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/src/main/sqldelight/migrations/8.sqm b/app/src/main/sqldelight/migrations/8.sqm index c80623439..1aa7d51f5 100644 --- a/app/src/main/sqldelight/migrations/8.sqm +++ b/app/src/main/sqldelight/migrations/8.sqm @@ -1,6 +1,25 @@ ALTER TABLE manga_sync RENAME TO manga_sync_tmp; +CREATE TABLE manga_sync( + _id INTEGER NOT NULL PRIMARY KEY, + manga_id INTEGER NOT NULL, + sync_id INTEGER NOT NULL, + remote_id INTEGER NOT NULL, + library_id INTEGER, + title TEXT NOT NULL, + last_chapter_read REAL NOT NULL, + total_chapters INTEGER NOT NULL, + status INTEGER NOT NULL, + score REAL AS Float NOT NULL, + remote_url TEXT NOT NULL, + start_date INTEGER AS Long NOT NULL, + finish_date INTEGER AS Long NOT NULL, + UNIQUE (manga_id, sync_id) ON CONFLICT REPLACE, + FOREIGN KEY(manga_id) REFERENCES mangas (_id) + ON DELETE CASCADE +); + INSERT INTO manga_sync(_id, manga_id, sync_id, remote_id, library_id, title, last_chapter_read, total_chapters, status, score, remote_url, start_date, finish_date) SELECT _id, manga_id, sync_id, remote_id, library_id, title, last_chapter_read, total_chapters, status, score, remote_url, start_date, finish_date FROM manga_sync_tmp;