Skip to content

Instantly share code, notes, and snippets.

@BramYeh
Last active November 28, 2017 12:28
Show Gist options
  • Select an option

  • Save BramYeh/001ee1547ffa0e5a8702bda8b2cf6797 to your computer and use it in GitHub Desktop.

Select an option

Save BramYeh/001ee1547ffa0e5a8702bda8b2cf6797 to your computer and use it in GitHub Desktop.
Schema verison 2 for Migrate SQLiteOpenHelper and SQLiteDatabase to Room (with Testing)
{
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "99c7946712f93a4d723efbe10a500eb0",
"entities": [
{
"tableName": "Users",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mId` INTEGER NOT NULL, `mUserName` TEXT, PRIMARY KEY(`mId`))",
"fields": [
{
"fieldPath": "mId",
"columnName": "mId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mUserName",
"columnName": "mUserName",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"mId"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
}
],
"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, \"99c7946712f93a4d723efbe10a500eb0\")"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment