-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added Client Migration for changing the validation status to Invalid #2109
base: master
Are you sure you want to change the base?
Changes from all commits
a7186bf
ef1328f
0737895
293b808
985705f
6109c03
ddcd139
b9e6f14
b6b64c0
61efb28
ca0aaa2
d81b0a7
fd56abc
e093fa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,8 +230,8 @@ android { | |
ba { | ||
dimension = 'baseDimension' | ||
applicationIdSuffix ".ba" | ||
versionCode 8 | ||
versionName "1.0.8" | ||
versionCode 9 | ||
versionName "1.0.9" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' | ||
|
@@ -244,13 +244,13 @@ android { | |
buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Ward", "MOH Jhpiego Facility Name", "Health Facility", "Village", "Village Sublocations"}' | ||
buildConfigField "String", 'DEFAULT_LOCATION', '"Village Sublocations"' | ||
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"Village"' | ||
buildConfigField "int", "DATABASE_VERSION", '23' | ||
buildConfigField "int", "DATABASE_VERSION", '24' | ||
} | ||
chad { | ||
dimension = 'baseDimension' | ||
applicationIdSuffix ".chad" | ||
versionCode 3 | ||
versionName "1.0.3" | ||
versionCode 4 | ||
versionName "1.0.4" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' | ||
|
@@ -262,18 +262,18 @@ android { | |
buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Clinic" , "CHSS" , "CHA"}' | ||
buildConfigField "String", 'DEFAULT_LOCATION', '"Village"' | ||
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHA"' | ||
buildConfigField "int", "DATABASE_VERSION", '15' | ||
buildConfigField "int", "DATABASE_VERSION", '16' | ||
buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '5' | ||
buildConfigField "int", "MAX_READ_TIMEOUT", '5' | ||
} | ||
drc { | ||
resConfigs "en", "fr" | ||
dimension = 'baseDimension' | ||
applicationIdSuffix ".drc" | ||
versionCode 11 | ||
versionName "1.0.16" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' | ||
versionCode 12 | ||
versionName "1.0.17" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' | ||
buildConfigField "String", 'opensrp_url', '"https://wcaro-cd.smartregister.org/opensrp/"' | ||
buildConfigField "String", 'guidebooks_url', '"https://opensrp.s3.amazonaws.com/media/drc/"' | ||
|
@@ -286,13 +286,13 @@ android { | |
buildConfigField "String", 'DEFAULT_LOCATION', '"VILLAGE/COMMUNAUTE"' | ||
buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '5' | ||
buildConfigField "int", "MAX_READ_TIMEOUT", '5' | ||
buildConfigField "int", "DATABASE_VERSION", '12' | ||
buildConfigField "int", "DATABASE_VERSION", '13' | ||
} | ||
guinea { | ||
dimension = 'baseDimension' | ||
applicationIdSuffix ".guinea" | ||
versionCode 4 | ||
versionName "1.0.3" | ||
versionCode 5 | ||
versionName "1.0.4" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '1000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '500' | ||
|
@@ -307,13 +307,13 @@ android { | |
buildConfigField "String", 'DEFAULT_LOCATION_PREVIEW', '"Village"' | ||
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHW"' | ||
buildConfigField "String", 'DEFAULT_LOCATION', '"Village"' | ||
buildConfigField "int", "DATABASE_VERSION", '8' | ||
buildConfigField "int", "DATABASE_VERSION", '9' | ||
} | ||
togo { | ||
dimension = 'baseDimension' | ||
applicationIdSuffix ".togo" | ||
versionCode 26 | ||
versionName "1.2.7" | ||
versionCode 27 | ||
versionName "1.2.8" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '1000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '500' | ||
|
@@ -327,12 +327,12 @@ android { | |
buildConfigField "String", 'DEFAULT_LOCATION', '"Village"' | ||
buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '10' | ||
buildConfigField "int", "MAX_READ_TIMEOUT", '10' | ||
buildConfigField "int", "DATABASE_VERSION", '21' | ||
buildConfigField "int", "DATABASE_VERSION", '22' | ||
} | ||
liberia { | ||
dimension = 'baseDimension' | ||
versionCode 8 | ||
versionName "1.0.1" | ||
versionCode 9 | ||
versionName "1.0.2" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '2' | ||
|
@@ -346,13 +346,13 @@ android { | |
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"CHA"' | ||
buildConfigField "int", "MAX_CONNECTION_TIMEOUT", '5' | ||
buildConfigField "int", "MAX_READ_TIMEOUT", '5' | ||
buildConfigField "int", "DATABASE_VERSION", '8' | ||
buildConfigField "int", "DATABASE_VERSION", '9' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
lmh { | ||
dimension = 'baseDimension' | ||
applicationIdSuffix ".lmh" | ||
versionCode 7 | ||
versionName "2.0.3" | ||
versionCode 8 | ||
versionName "2.0.4" | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_INITIAL_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_BATCH_SIZE", '10000' | ||
buildConfigField "int", "OPENMRS_UNIQUE_ID_SOURCE", '1' | ||
|
@@ -364,7 +364,7 @@ android { | |
buildConfigField "String[]", "ALLOWED_LOCATION_LEVELS_DEBUG", '{"Country" , "County" , "District", "Clinics", "CHSS", "Village","Commune"}' | ||
buildConfigField "String", 'DEFAULT_LOCATION', '"Commune"' | ||
buildConfigField "String", 'DEFAULT_LOCATION_DEBUG', '"Commune"' | ||
buildConfigField "int", "DATABASE_VERSION", '7' | ||
buildConfigField "int", "DATABASE_VERSION", '8' | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,11 +48,15 @@ public static void onUpgrade(Context context, SQLiteDatabase db, int oldVersion, | |
case 12: | ||
upgradeToVersion12(db); | ||
break; | ||
case 13: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make these changes for all the flavours
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ekigamba different flavors use different DB versions for instance ba is at version 23 chad using 15 drc using 13 and so on should i upgrade all the versions to the same value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea, we should upgrade all the versions but to different values |
||
upgradeToVersion13(db); | ||
break; | ||
default: | ||
break; | ||
} | ||
upgradeTo++; | ||
} | ||
RepositoryUtils.updateClientValidateStatus(db); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this since it is repetitive |
||
} | ||
|
||
private static void upgradeToVersion2(Context context, SQLiteDatabase db) { | ||
|
@@ -165,4 +169,8 @@ private static void upgradeToVersion11(SQLiteDatabase db) { | |
private static void upgradeToVersion12(SQLiteDatabase db) { | ||
RepositoryUtils.updateNullEventIds(db); | ||
} | ||
|
||
private static void upgradeToVersion13(SQLiteDatabase db) { | ||
RepositoryUtils.updateClientValidateStatus(db); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.smartregister.chw.repository; | ||
|
||
import net.sqlcipher.database.SQLiteDatabase; | ||
|
||
import org.junit.Test; | ||
import org.mockito.Mockito; | ||
import org.smartregister.immunization.repository.VaccineRepository; | ||
|
||
import static org.mockito.Mockito.verify; | ||
|
||
|
||
public class ChwRepositoryFlvTest { | ||
|
||
@Test | ||
public void testOnUpgrade() { | ||
SQLiteDatabase db = Mockito.mock(SQLiteDatabase.class); | ||
ChwRepositoryFlv.onUpgrade(null, db, 1, 2); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_EVENT_ID_COL); | ||
verify(db).execSQL(VaccineRepository.EVENT_ID_INDEX); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_FORMSUBMISSION_ID_COL); | ||
verify(db).execSQL(VaccineRepository.FORMSUBMISSION_INDEX); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_OUT_OF_AREA_COL_INDEX); | ||
verify(db).execSQL(VaccineRepository.UPDATE_TABLE_ADD_HIA2_STATUS_COL); | ||
|
||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what's the difference between liberia and LMH