Skip to content
Snippets Groups Projects
Unverified Commit d6cb8674 authored by Jed Fox's avatar Jed Fox Committed by GitHub
Browse files

Fix ID for transaction_filters migration (#1309)

parent 2a627ef9
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,20 @@ export function getUpMigration(id, names) {
}
}
async function patchBadMigrations(db: Database) {
let badFiltersMigration = 1685375406832;
let newFiltersMigration = 1688749527273;
let appliedIds = await getAppliedMigrations(db);
if (appliedIds.includes(badFiltersMigration)) {
await sqlite.runQuery(db, 'DELETE FROM __migrations__ WHERE id = ?', [
badFiltersMigration,
]);
await sqlite.runQuery(db, 'INSERT INTO __migrations__ (id) VALUES (?)', [
newFiltersMigration,
]);
}
}
export async function getAppliedMigrations(db: Database): Promise<number[]> {
const rows = await sqlite.runQuery<{ id: number }>(
db,
......@@ -135,6 +149,7 @@ function checkDatabaseValidity(
}
export async function migrate(db: Database): Promise<string[]> {
await patchBadMigrations(db);
let appliedIds = await getAppliedMigrations(db);
let available = await getMigrationList(MIGRATIONS_DIR);
......
---
category: Bugfix
authors: [j-f1]
---
Handle upgrading from some recent `edge` versions to newer versions of Actual
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