Coverage Summary for Class: AccountArchivedAtMigrationKt (com.georgeci.moneysurfer.data.db.migration)
| Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
| AccountArchivedAtMigrationKt |
100%
(1/1)
|
|
100%
(1/1)
|
100%
(6/6)
|
| AccountArchivedAtMigrationKt$MIGRATION_29_30$1 |
50%
(1/2)
|
|
50%
(1/2)
|
57.1%
(4/7)
|
| Total |
66.7%
(2/3)
|
|
66.7%
(2/3)
|
76.9%
(10/13)
|
package com.georgeci.moneysurfer.data.db.migration
import androidx.room.migration.Migration
import androidx.sqlite.SQLiteConnection
import androidx.sqlite.execSQL
/**
* v29 → v30: add `accounts.archivedAt` so the manage list can say *when* an account was archived.
*
* Rows archived before this column existed have no recorded date, and `updatedAt` is not a stand-in
* — balance recalculation bumps it long after the archive. They stay `NULL`, and the archived row
* falls back to the plain type label rather than inventing a month.
*/
val MIGRATION_29_30: Migration = object : Migration(29, 30) {
override fun migrate(connection: SQLiteConnection) {
connection.execSQL("ALTER TABLE `accounts` ADD COLUMN `archivedAt` INTEGER DEFAULT NULL")
}
}