mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 12:56:45 -06:00
[DB] Fix migration compatibility for different app versions
This commit is contained in:
parent
0395598efb
commit
25744037f5
@ -577,6 +577,13 @@ public abstract class AppDb extends RoomDatabase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
private static final Migration MIGRATION_54_55 = new Migration(54, 55) {
|
private static final Migration MIGRATION_54_55 = new Migration(54, 55) {
|
||||||
|
@Override
|
||||||
|
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||||
|
// 2019-10-21 for merge compatibility between 3.1.1 and api-v2
|
||||||
|
// moved to Migration 55->56
|
||||||
|
}
|
||||||
|
};
|
||||||
|
private static final Migration MIGRATION_55_56 = new Migration(55, 56) {
|
||||||
@Override
|
@Override
|
||||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||||
database.execSQL("CREATE TABLE IF NOT EXISTS endpointTimers (" +
|
database.execSQL("CREATE TABLE IF NOT EXISTS endpointTimers (" +
|
||||||
@ -587,11 +594,6 @@ public abstract class AppDb extends RoomDatabase {
|
|||||||
"endpointViewId INTEGER DEFAULT NULL," +
|
"endpointViewId INTEGER DEFAULT NULL," +
|
||||||
"PRIMARY KEY(profileId, endpointId)" +
|
"PRIMARY KEY(profileId, endpointId)" +
|
||||||
")");
|
")");
|
||||||
}
|
|
||||||
};
|
|
||||||
private static final Migration MIGRATION_55_56 = new Migration(55, 56) {
|
|
||||||
@Override
|
|
||||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
|
||||||
database.execSQL("CREATE TABLE IF NOT EXISTS lessonRanges (" +
|
database.execSQL("CREATE TABLE IF NOT EXISTS lessonRanges (" +
|
||||||
"profileId INTEGER NOT NULL," +
|
"profileId INTEGER NOT NULL," +
|
||||||
"lessonRangeNumber INTEGER NOT NULL," +
|
"lessonRangeNumber INTEGER NOT NULL," +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user