Fix migration

This commit is contained in:
sadellie 2023-07-29 21:22:30 +03:00
parent 768356020e
commit 19f1f436c3
2 changed files with 17 additions and 48 deletions

View File

@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "ab71572ff5556256d1f042af36243f6f",
"identityHash": "d5dca9e0346c3400b7ff5b31e85c7827",
"entities": [
{
"tableName": "units",
@ -34,10 +34,10 @@
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"unitId"
]
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": []
@ -72,42 +72,10 @@
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"entityId"
]
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "time_zones",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `position` INTEGER NOT NULL, `label` TEXT NOT NULL, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "position",
"columnName": "position",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "label",
"columnName": "label",
"affinity": "TEXT",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": false,
"columnNames": [
"id"
]
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
@ -116,7 +84,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, 'ab71572ff5556256d1f042af36243f6f')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'd5dca9e0346c3400b7ff5b31e85c7827')"
]
}
}

View File

@ -56,16 +56,17 @@ class UnittoDatabaseModule {
return unittoDatabase.calculatorHistoryDao()
}
/**
* Tells Hilt to use this method to get [TimeZoneDao]
*
* @param unittoDatabase Database for which we need DAO
* @return Singleton of [TimeZoneDao]
*/
@Provides
fun provideTimeZoneDao(unittoDatabase: UnittoDatabase): TimeZoneDao {
return unittoDatabase.timeZoneDao()
}
// For some reason this fucks up the migration
// /**
// * Tells Hilt to use this method to get [TimeZoneDao]
// *
// * @param unittoDatabase Database for which we need DAO
// * @return Singleton of [TimeZoneDao]
// */
// @Provides
// fun provideTimeZoneDao(unittoDatabase: UnittoDatabase): TimeZoneDao {
// return unittoDatabase.timeZoneDao()
// }
/**
* Tells Hilt to use this method to get [UnittoDatabase]