diff --git a/app/src/main/java/net/foucry/pilldroid/PilldroidDatabase.java b/app/src/main/java/net/foucry/pilldroid/PilldroidDatabase.java index 8cb1415..0b11ddf 100644 --- a/app/src/main/java/net/foucry/pilldroid/PilldroidDatabase.java +++ b/app/src/main/java/net/foucry/pilldroid/PilldroidDatabase.java @@ -1,13 +1,24 @@ package net.foucry.pilldroid; +import androidx.room.AutoMigration; import androidx.room.Database; import androidx.room.RoomDatabase; +import androidx.room.migration.Migration; +import androidx.sqlite.db.SupportSQLiteDatabase; import net.foucry.pilldroid.dao.MedicDAO; import net.foucry.pilldroid.models.Medic; -@Database(entities = {Medic.class}, version = 2) +@Database( + version = 3, + entities = {Medic.class}, + autoMigrations = { + @AutoMigration(from = 1, to = 2), + @AutoMigration(from = 2, to = 3), + }, + exportSchema = true +) public abstract class PilldroidDatabase extends RoomDatabase { - public abstract MedicDAO getMedicDAO(); + public abstract MedicDAO getMedicDAO(); }