Add option: bypass China only

Fix #569.

It could have worked without upgrading database by using an option called `bypass-china-only`. But I think we will get better readability this way.
This commit is contained in:
Mygod
2016-02-08 15:44:10 +08:00
parent 3556eebfeb
commit 06deb4bbcb
7 changed files with 22 additions and 60 deletions
@@ -64,7 +64,7 @@ object DBHelper {
}
class DBHelper(val context: Context)
extends OrmLiteSqliteOpenHelper(context, DBHelper.PROFILE, null, 15) {
extends OrmLiteSqliteOpenHelper(context, DBHelper.PROFILE, null, 16) {
import DBHelper._
lazy val profileDao: Dao[Profile, Int] = getDao(classOf[Profile])
@@ -121,6 +121,10 @@ class DBHelper(val context: Context)
i += 1
}
}
if (oldVersion < 16) {
profileDao.executeRawNoArgs("UPDATE `profile` SET route = 'bypass-lan-china' WHERE route = 'bypass-china'")
}
}
}
}