Merge pull request #297 from nightscout/newdb

Schema export
This commit is contained in:
Milos Kozak 2021-02-09 11:28:17 +01:00 committed by GitHub
commit 5683d75162
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2702 additions and 3 deletions

View file

@ -9,7 +9,9 @@ import javax.inject.Inject
class DismissNotificationService : DaggerIntentService(DismissNotificationService::class.simpleName) { class DismissNotificationService : DaggerIntentService(DismissNotificationService::class.simpleName) {
@Inject lateinit var rxBus: RxBusWrapper @Inject lateinit var rxBus: RxBusWrapper
override fun onHandleIntent(intent: Intent) { override fun onHandleIntent(intent: Intent?) {
intent?.let {
rxBus.send(EventDismissNotification(intent.getIntExtra("alertID", -1))) rxBus.send(EventDismissNotification(intent.getIntExtra("alertID", -1)))
} }
}
} }

View file

@ -10,6 +10,12 @@ android {
targetSdkVersion 28 targetSdkVersion 28
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
kapt {
arguments {
arg("room.incremental", "true")
arg("room.schemaLocation", "$projectDir/schemas")
}
}
} }
buildTypes { buildTypes {
@ -45,6 +51,8 @@ dependencies {
api "androidx.room:room-runtime:$room_version" api "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version" kapt "androidx.room:room-compiler:$room_version"
/* Database schema export */
kapt "android.arch.persistence.room:compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version" implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.room:room-rxjava2:$room_version" implementation "androidx.room:room-rxjava2:$room_version"

File diff suppressed because it is too large Load diff

View file

@ -14,7 +14,7 @@ const val DATABASE_VERSION = 1
@Database(version = DATABASE_VERSION, entities = arrayOf(APSResult::class, Bolus::class, BolusCalculatorResult::class, Carbs::class, @Database(version = DATABASE_VERSION, entities = arrayOf(APSResult::class, Bolus::class, BolusCalculatorResult::class, Carbs::class,
EffectiveProfileSwitch::class, ExtendedBolus::class, GlucoseValue::class, ProfileSwitch::class, EffectiveProfileSwitch::class, ExtendedBolus::class, GlucoseValue::class, ProfileSwitch::class,
TemporaryBasal::class, TemporaryTarget::class, TherapyEvent::class, TotalDailyDose::class, TemporaryBasal::class, TemporaryTarget::class, TherapyEvent::class, TotalDailyDose::class,
APSResultLink::class, MealLink::class, MultiwaveBolusLink::class, PreferenceChange::class, VersionChange::class)) APSResultLink::class, MealLink::class, MultiwaveBolusLink::class, PreferenceChange::class, VersionChange::class), exportSchema = true)
@TypeConverters(Converters::class) @TypeConverters(Converters::class)
internal abstract class AppDatabase : RoomDatabase() { internal abstract class AppDatabase : RoomDatabase() {