Protect table creation with transaction

This commit is contained in:
Max Lv
2017-08-10 08:39:49 +08:00
parent 2c8718163a
commit f25406b86c
@@ -141,7 +141,9 @@ class DBHelper(val context: Context)
}
if (oldVersion < 23) {
profileDao.executeRawNoArgs("BEGIN TRANSACTION;")
TableUtils.createTable(connectionSource, classOf[KeyValuePair])
profileDao.executeRawNoArgs("COMMIT;")
import KeyValuePair._
val old = PreferenceManager.getDefaultSharedPreferences(app)
kvPairDao.createOrUpdate(new KeyValuePair(Key.id, TYPE_INT,