Issue#3 Start exporting schemas
This commit is contained in:
parent
fa1fc49d0b
commit
4a1254d092
3 changed files with 45 additions and 1 deletions
|
|
@ -17,6 +17,12 @@ android {
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
buildConfigField "String", "BASE_URL", '"https://606844a10add49001733fe6b.mockapi.io/"'
|
buildConfigField "String", "BASE_URL", '"https://606844a10add49001733fe6b.mockapi.io/"'
|
||||||
|
|
||||||
|
kapt {
|
||||||
|
arguments {
|
||||||
|
arg("room.schemaLocation", "$projectDir/schemas")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
{
|
||||||
|
"formatVersion": 1,
|
||||||
|
"database": {
|
||||||
|
"version": 1,
|
||||||
|
"identityHash": "36d840e89667f36e0c265593da36fe23",
|
||||||
|
"entities": [
|
||||||
|
{
|
||||||
|
"tableName": "FavouriteEntity",
|
||||||
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`contentId` TEXT NOT NULL, PRIMARY KEY(`contentId`))",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldPath": "contentId",
|
||||||
|
"columnName": "contentId",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primaryKey": {
|
||||||
|
"columnNames": [
|
||||||
|
"contentId"
|
||||||
|
],
|
||||||
|
"autoGenerate": false
|
||||||
|
},
|
||||||
|
"indices": [],
|
||||||
|
"foreignKeys": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"views": [],
|
||||||
|
"setupQueries": [
|
||||||
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '36d840e89667f36e0c265593da36fe23')"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,11 @@ import androidx.room.RoomDatabase
|
||||||
import org.fnives.test.showcase.storage.favourite.FavouriteDao
|
import org.fnives.test.showcase.storage.favourite.FavouriteDao
|
||||||
import org.fnives.test.showcase.storage.favourite.FavouriteEntity
|
import org.fnives.test.showcase.storage.favourite.FavouriteEntity
|
||||||
|
|
||||||
@Database(entities = [FavouriteEntity::class], version = 1, exportSchema = false)
|
@Database(
|
||||||
|
entities = [FavouriteEntity::class],
|
||||||
|
version = 1,
|
||||||
|
exportSchema = true
|
||||||
|
)
|
||||||
abstract class LocalDatabase : RoomDatabase() {
|
abstract class LocalDatabase : RoomDatabase() {
|
||||||
|
|
||||||
abstract val favouriteDao: FavouriteDao
|
abstract val favouriteDao: FavouriteDao
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue