mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
fix: renumber worktree merge history migrations
This commit is contained in:
parent
ae6aac044d
commit
d47ec56eca
12 changed files with 215 additions and 136 deletions
|
|
@ -32,6 +32,7 @@ import {
|
|||
formatDatabaseBackupResult,
|
||||
goals,
|
||||
heartbeatRuns,
|
||||
inspectMigrations,
|
||||
issueAttachments,
|
||||
issueComments,
|
||||
issueDocuments,
|
||||
|
|
@ -1392,6 +1393,16 @@ async function openConfiguredDb(configPath: string): Promise<OpenDbHandle> {
|
|||
);
|
||||
}
|
||||
const connectionString = resolveSourceConnectionString(config, envEntries, embeddedHandle?.port);
|
||||
const migrationState = await inspectMigrations(connectionString);
|
||||
if (migrationState.status !== "upToDate") {
|
||||
const pending =
|
||||
migrationState.reason === "pending-migrations"
|
||||
? ` Pending migrations: ${migrationState.pendingMigrations.join(", ")}.`
|
||||
: "";
|
||||
throw new Error(
|
||||
`Database for ${configPath} is not up to date.${pending} Run \`pnpm db:migrate\` (or start Paperclip once) before using worktree merge history.`,
|
||||
);
|
||||
}
|
||||
const db = createDb(connectionString) as ClosableDb;
|
||||
return {
|
||||
db,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue