Skip to content
Snippets Groups Projects
Unverified Commit e8872598 authored by Kolya Opahle's avatar Kolya Opahle
Browse files

Updated schema to match db naming

parent 8b6a4522
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,10 @@
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "02f231d9ba162399bf1884e74266fa0e",
"identityHash": "857201ec8eba4f3c64ca96c8975ceb69",
"entities": [
{
"tableName": "ContactDiaryLocationEntity",
"tableName": "locations",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`locationId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `locationName` TEXT NOT NULL)",
"fields": [
{
......@@ -31,8 +31,8 @@
"foreignKeys": []
},
{
"tableName": "ContactDiaryLocationVisitEntity",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` TEXT NOT NULL, `fkLocationId` INTEGER NOT NULL, FOREIGN KEY(`fkLocationId`) REFERENCES `ContactDiaryLocationEntity`(`locationId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
"tableName": "locationvisits",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` TEXT NOT NULL, `fkLocationId` INTEGER NOT NULL, FOREIGN KEY(`fkLocationId`) REFERENCES `locations`(`locationId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
"fields": [
{
"fieldPath": "id",
......@@ -59,10 +59,19 @@
],
"autoGenerate": true
},
"indices": [],
"indices": [
{
"name": "index_locationvisits_fkLocationId",
"unique": false,
"columnNames": [
"fkLocationId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_locationvisits_fkLocationId` ON `${TABLE_NAME}` (`fkLocationId`)"
}
],
"foreignKeys": [
{
"table": "ContactDiaryLocationEntity",
"table": "locations",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
......@@ -75,7 +84,7 @@
]
},
{
"tableName": "ContactDiaryPersonEntity",
"tableName": "persons",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`personId` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `fullName` TEXT NOT NULL)",
"fields": [
{
......@@ -101,8 +110,8 @@
"foreignKeys": []
},
{
"tableName": "ContactDiaryPersonEncounterEntity",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` TEXT NOT NULL, `fkPersonId` INTEGER NOT NULL, FOREIGN KEY(`fkPersonId`) REFERENCES `ContactDiaryPersonEntity`(`personId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
"tableName": "personencounters",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` TEXT NOT NULL, `fkPersonId` INTEGER NOT NULL, FOREIGN KEY(`fkPersonId`) REFERENCES `persons`(`personId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
"fields": [
{
"fieldPath": "id",
......@@ -129,10 +138,19 @@
],
"autoGenerate": true
},
"indices": [],
"indices": [
{
"name": "index_personencounters_fkPersonId",
"unique": false,
"columnNames": [
"fkPersonId"
],
"createSql": "CREATE INDEX IF NOT EXISTS `index_personencounters_fkPersonId` ON `${TABLE_NAME}` (`fkPersonId`)"
}
],
"foreignKeys": [
{
"table": "ContactDiaryPersonEntity",
"table": "persons",
"onDelete": "CASCADE",
"onUpdate": "CASCADE",
"columns": [
......@@ -148,7 +166,7 @@
"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, '02f231d9ba162399bf1884e74266fa0e')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '857201ec8eba4f3c64ca96c8975ceb69')"
]
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment