1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-26 09:44:31 +02:00

upgrade version number to 1.7 beta

This commit is contained in:
OliE
2018-01-06 11:43:52 +01:00
parent 32d870c781
commit 7d7351463d
2 changed files with 10 additions and 8 deletions

View File

@@ -7,8 +7,8 @@ android {
applicationId "com.health.openscale" applicationId "com.health.openscale"
minSdkVersion 18 minSdkVersion 18
targetSdkVersion 22 // don't set target sdk > 22 otherwise bluetooth le discovery need permission to ACCESS_COARSE_LOCATION targetSdkVersion 22 // don't set target sdk > 22 otherwise bluetooth le discovery need permission to ACCESS_COARSE_LOCATION
versionCode 21 versionCode 22
versionName "1.6.1" versionName "1.7 (beta)"
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { arguments = ["room.schemaLocation":"$projectDir/schemas".toString()] } annotationProcessorOptions { arguments = ["room.schemaLocation":"$projectDir/schemas".toString()] }

View File

@@ -97,16 +97,18 @@ public class OpenScale {
} }
private void migrateSQLtoRoom() { private void migrateSQLtoRoom() {
List<ScaleUser> scaleUserList = scaleUserDB.getScaleUserList(); List<ScaleUser> oldScaleUserList = scaleUserDB.getScaleUserList();
if (scaleDB.getReadableDatabase().getVersion() == 6 && userDAO.getAll().isEmpty() && !scaleUserList.isEmpty()) { if (scaleDB.getReadableDatabase().getVersion() == 6 && userDAO.getAll().isEmpty() && !oldScaleUserList.isEmpty()) {
Toast.makeText(context, "Migrating old SQL database to new database format...", Toast.LENGTH_LONG).show(); Toast.makeText(context, "Migrating old SQL database to new database format...", Toast.LENGTH_LONG).show();
userDAO.insertAll(scaleUserList); userDAO.insertAll(oldScaleUserList);
for (ScaleUser user : scaleUserList) { for (ScaleUser user : oldScaleUserList) {
List<ScaleMeasurement> scaleMeasurementList = scaleDB.getScaleDataList(user.getId()); List<ScaleMeasurement> oldScaleMeasurementList = scaleDB.getScaleDataList(user.getId());
measurementDAO.insertAll(scaleMeasurementList); measurementDAO.insertAll(oldScaleMeasurementList);
} }
Toast.makeText(context, "Finished migrating old SQL database to new database format", Toast.LENGTH_LONG).show();
} }
} }