mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-01-05 13:38:03 -05:00
Fix botched migration and release 2.7.3
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## v2.7.3 - 88 (2021-10-10)
|
||||
|
||||
- Fix incorrect migration making first card become invisible
|
||||
|
||||
## v2.7.2 - 87 (2021-10-09)
|
||||
|
||||
- Fix regression breaking import/export
|
||||
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
applicationId "me.hackerchick.catima"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 31
|
||||
versionCode 87
|
||||
versionName "2.7.2"
|
||||
versionCode 88
|
||||
versionName "2.7.3"
|
||||
|
||||
vectorDrawables.useSupportLibrary true
|
||||
multiDexEnabled true
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
{
|
||||
public static final String DATABASE_NAME = "Catima.db";
|
||||
public static final int ORIGINAL_DATABASE_VERSION = 1;
|
||||
public static final int DATABASE_VERSION = 12;
|
||||
public static final int DATABASE_VERSION = 13;
|
||||
|
||||
public static class LoyaltyCardDbGroups
|
||||
{
|
||||
@@ -294,6 +294,24 @@ public class DBHelper extends SQLiteOpenHelper
|
||||
insertFTS(db, loyaltyCard.id, loyaltyCard.store, loyaltyCard.note);
|
||||
}
|
||||
}
|
||||
|
||||
if(oldVersion < 13 && newVersion >= 13)
|
||||
{
|
||||
db.execSQL("DELETE FROM " + LoyaltyCardDbFTS.TABLE + ";");
|
||||
|
||||
Cursor cursor = db.rawQuery("SELECT * FROM " + LoyaltyCardDbIds.TABLE + ";", null, null);
|
||||
|
||||
if (cursor.moveToFirst()) {
|
||||
LoyaltyCard loyaltyCard = LoyaltyCard.toLoyaltyCard(cursor);
|
||||
insertFTS(db, loyaltyCard.id, loyaltyCard.store, loyaltyCard.note);
|
||||
|
||||
while (cursor.moveToNext()) {
|
||||
loyaltyCard = LoyaltyCard.toLoyaltyCard(cursor);
|
||||
insertFTS(db, loyaltyCard.id, loyaltyCard.store, loyaltyCard.note);
|
||||
}
|
||||
}
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
private ContentValues generateFTSContentValues(final int id, final String store, final String note) {
|
||||
|
||||
Reference in New Issue
Block a user