add TrafficMonitor

This commit is contained in:
Max Lv
2015-11-12 12:10:38 +08:00
parent 4e4e0514d8
commit 6749afd263
3 changed files with 98 additions and 1 deletions
@@ -51,7 +51,7 @@ object DBHelper {
}
class DBHelper(val context: Context)
extends OrmLiteSqliteOpenHelper(context, DBHelper.PROFILE, null, 12) {
extends OrmLiteSqliteOpenHelper(context, DBHelper.PROFILE, null, 13) {
lazy val profileDao: Dao[Profile, Int] = getDao(classOf[Profile])
@@ -89,6 +89,11 @@ class DBHelper(val context: Context)
" ipv6, individual FROM `tmp`;")
profileDao.executeRawNoArgs("DROP TABLE `tmp`;")
}
if (oldVersion < 13) {
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN tx LONG;")
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN rx LONG;")
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN date DATE;")
}
}
}
}
@@ -83,4 +83,13 @@ class Profile {
@DatabaseField(dataType = DataType.LONG_STRING)
var individual: String = ""
@DatabaseField
var tx: Long = 0
@DatabaseField
var rx: Long = 0
@DatabaseField
val date: java.util.Date = new java.util.Date()
}