| 220 | * Get migration history from database |
| 221 | */ |
| 222 | export function getMigrationHistory( |
| 223 | db: SqliteDatabase |
| 224 | ): Array<{ version: number; appliedAt: number; description: string | null }> { |
| 225 | const rows = db |
| 226 | .prepare('SELECT version, applied_at, description FROM schema_versions ORDER BY version') |
| 227 | .all() as Array<{ version: number; applied_at: number; description: string | null }>; |
| 228 | |
| 229 | return rows.map((row) => ({ |
| 230 | version: row.version, |
| 231 | appliedAt: row.applied_at, |
| 232 | description: row.description, |
| 233 | })); |
| 234 | } |