Drop FOREIGN KEY for eh_favorites
This commit is contained in:
parent
164db54acd
commit
912d2ecd62
@ -26,7 +26,7 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "eu.kanade.tachiyomi.sy"
|
applicationId = "eu.kanade.tachiyomi.sy"
|
||||||
versionCode = 53
|
versionCode = 54
|
||||||
versionName = "1.9.3"
|
versionName = "1.9.3"
|
||||||
|
|
||||||
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package tachiyomi.data.manga
|
package tachiyomi.data.manga
|
||||||
|
|
||||||
|
import logcat.LogPriority
|
||||||
|
import tachiyomi.core.util.system.logcat
|
||||||
import tachiyomi.data.DatabaseHandler
|
import tachiyomi.data.DatabaseHandler
|
||||||
import tachiyomi.domain.manga.model.FavoriteEntry
|
import tachiyomi.domain.manga.model.FavoriteEntry
|
||||||
import tachiyomi.domain.manga.model.FavoriteEntryAlternative
|
import tachiyomi.domain.manga.model.FavoriteEntryAlternative
|
||||||
@ -30,13 +32,18 @@ class FavoritesEntryRepositoryImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun addAlternative(favoriteEntryAlternative: FavoriteEntryAlternative) {
|
override suspend fun addAlternative(favoriteEntryAlternative: FavoriteEntryAlternative) {
|
||||||
handler.await {
|
try {
|
||||||
eh_favoritesQueries.addAlternative(
|
handler.await {
|
||||||
otherGid = favoriteEntryAlternative.otherGid,
|
eh_favoritesQueries.addAlternative(
|
||||||
otherToken = favoriteEntryAlternative.otherToken,
|
otherGid = favoriteEntryAlternative.otherGid,
|
||||||
gid = favoriteEntryAlternative.gid,
|
otherToken = favoriteEntryAlternative.otherToken,
|
||||||
token = favoriteEntryAlternative.token,
|
gid = favoriteEntryAlternative.gid,
|
||||||
)
|
token = favoriteEntryAlternative.token,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
logcat(LogPriority.INFO, e)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ CREATE TABLE eh_favorites_alternatives (
|
|||||||
token TEXT NOT NULL,
|
token TEXT NOT NULL,
|
||||||
otherGid TEXT NOT NULL,
|
otherGid TEXT NOT NULL,
|
||||||
otherToken TEXT NOT NULL,
|
otherToken TEXT NOT NULL,
|
||||||
FOREIGN KEY (gid, token) REFERENCES eh_favorites(gid, token)
|
UNIQUE (gid, token, otherGid, otherToken)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE INDEX eh_favorites_alternatives_gid_token_index ON eh_favorites_alternatives(gid, token);
|
CREATE INDEX eh_favorites_alternatives_gid_token_index ON eh_favorites_alternatives(gid, token);
|
||||||
|
16
data/src/main/sqldelight/tachiyomi/migrations/27.sqm
Normal file
16
data/src/main/sqldelight/tachiyomi/migrations/27.sqm
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
DROP INDEX IF EXISTS eh_favorites_alternatives_gid_token_index;
|
||||||
|
DROP INDEX IF EXISTS eh_favorites_alternatives_other_gid_token_index;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS eh_favorites_alternatives;
|
||||||
|
|
||||||
|
CREATE TABLE eh_favorites_alternatives (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
gid TEXT NOT NULL,
|
||||||
|
token TEXT NOT NULL,
|
||||||
|
otherGid TEXT NOT NULL,
|
||||||
|
otherToken TEXT NOT NULL,
|
||||||
|
UNIQUE (gid, token, otherGid, otherToken)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE INDEX eh_favorites_alternatives_gid_token_index ON eh_favorites_alternatives(gid, token);
|
||||||
|
CREATE INDEX eh_favorites_alternatives_other_gid_token_index ON eh_favorites_alternatives(otherGid, otherToken);
|
Loading…
x
Reference in New Issue
Block a user