Commit a5ef0cd6 authored by Mygod's avatar Mygod

Fix upgrading database from 13

parent 0612a004
...@@ -110,16 +110,11 @@ class DBHelper(val context: Context) ...@@ -110,16 +110,11 @@ class DBHelper(val context: Context)
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN rx LONG;") profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN rx LONG;")
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN date VARCHAR;") profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN date VARCHAR;")
} }
if (oldVersion < 14) {
for (profile <- profileDao.queryForAll.asScala) {
profile.individual = updateProxiedApps(context, profile.individual)
profileDao.update(profile)
}
}
if (oldVersion < 15) { if (oldVersion < 15) {
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN userOrder LONG;") profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN userOrder LONG;")
var i = 0 var i = 0
for (profile <- profileDao.queryForAll.asScala) { for (profile <- profileDao.queryForAll.asScala) {
if (oldVersion < 14) profile.individual = updateProxiedApps(context, profile.individual)
profile.userOrder = i profile.userOrder = i
profileDao.update(profile) profileDao.update(profile)
i += 1 i += 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment