From e81f93e3581cd73c903f2df8ba89df71ace1353a Mon Sep 17 00:00:00 2001 From: crackededed <90209774+crackededed@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:55:07 +0300 Subject: [PATCH] fix database migration (cherry picked from commit d84601925546baa9a9155a547f572d6fa35cd770) --- app/build.gradle.kts | 2 +- .../java/com/github/andreyasadchy/xtra/di/DatabaseModule.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 01cf5674..6541a934 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -28,7 +28,7 @@ android { minSdk = 16 targetSdk = 34 versionCode = 121 - versionName = "2.32.2" + versionName = "2.32.3" } buildTypes { diff --git a/app/src/main/java/com/github/andreyasadchy/xtra/di/DatabaseModule.kt b/app/src/main/java/com/github/andreyasadchy/xtra/di/DatabaseModule.kt index bdb97c2b..76011785 100644 --- a/app/src/main/java/com/github/andreyasadchy/xtra/di/DatabaseModule.kt +++ b/app/src/main/java/com/github/andreyasadchy/xtra/di/DatabaseModule.kt @@ -233,7 +233,7 @@ class DatabaseModule { override fun migrate(db: SupportSQLiteDatabase) { db.execSQL("DROP TABLE requests") db.execSQL("CREATE TABLE IF NOT EXISTS videos1 (url TEXT, source_url TEXT, source_start_position INTEGER, name TEXT, channel_id TEXT, channel_login TEXT, channel_name TEXT, channel_logo TEXT, thumbnail TEXT, gameId TEXT, gameSlug TEXT, gameName TEXT, duration INTEGER, upload_date INTEGER, download_date INTEGER, last_watch_position INTEGER, progress INTEGER NOT NULL, max_progress INTEGER NOT NULL, bytes INTEGER NOT NULL, downloadPath TEXT, fromTime INTEGER, toTime INTEGER, status INTEGER NOT NULL, type TEXT, videoId TEXT, clipId TEXT, quality TEXT, downloadChat INTEGER NOT NULL, downloadChatEmotes INTEGER NOT NULL, chatProgress INTEGER NOT NULL, maxChatProgress INTEGER NOT NULL, chatBytes INTEGER NOT NULL, chatOffsetSeconds INTEGER NOT NULL, chatUrl TEXT, playlistToFile INTEGER NOT NULL, id INTEGER NOT NULL, PRIMARY KEY (id))") - db.execSQL("INSERT INTO videos1 (url, source_url, source_start_position, name, channel_id, channel_login, channel_name, channel_logo, thumbnail, gameId, gameSlug, gameName, duration, upload_date, download_date, last_watch_position, progress, max_progress, bytes, downloadPath, fromTime, toTime, status, type, videoId, quality, downloadChat, downloadChatEmotes, chatProgress, maxChatProgress, chatBytes, chatOffsetSeconds, chatUrl, playlistToFile, id) SELECT url, source_url, source_start_position, name, channel_id, channel_login, channel_name, channel_logo, thumbnail, gameId, gameSlug, gameName, duration, upload_date, download_date, last_watch_position, progress, max_progress, 0, downloadPath, fromTime, toTime, status, type, videoId, quality, downloadChat, downloadChatEmotes, chatProgress, 100, 0, 0, chatUrl, 0, id FROM videos") + db.execSQL("INSERT INTO videos1 (url, source_url, source_start_position, name, channel_id, channel_login, channel_name, channel_logo, thumbnail, gameId, gameSlug, gameName, duration, upload_date, download_date, last_watch_position, progress, max_progress, bytes, downloadPath, fromTime, toTime, status, type, videoId, quality, downloadChat, downloadChatEmotes, chatProgress, maxChatProgress, chatBytes, chatOffsetSeconds, chatUrl, playlistToFile, id) SELECT url, source_url, source_start_position, name, channel_id, channel_login, channel_name, channel_logo, thumbnail, gameId, gameSlug, gameName, duration, upload_date, download_date, last_watch_position, progress, max_progress, 0, downloadPath, fromTime, toTime, status, type, videoId, quality, 0, 0, 0, 100, 0, 0, chatUrl, 0, id FROM videos") db.execSQL("DROP TABLE videos") db.execSQL("ALTER TABLE videos1 RENAME TO videos") }