paperclipai/paperclip · error
Duplicate migration number ${number} in ${label}: ${existing
Error message
Duplicate migration number ${number} in ${label}: ${existing}, ${value} What it means
Error "Duplicate migration number ${number} in ${label}: ${existing}, ${value}" thrown in paperclipai/paperclip.
Source
Thrown at packages/db/src/check-migration-numbering.ts:29
}>;
};
function migrationNumber(value: string): string | null {
const match = value.match(/^(\d{4})_/);
return match ? match[1] : null;
}
function ensureNoDuplicates(values: string[], label: string) {
const seen = new Map<string, string>();
for (const value of values) {
const number = migrationNumber(value);
if (!number) {
throw new Error(`${label} entry does not start with a 4-digit migration number: ${value}`);
}
const existing = seen.get(number);
if (existing) {
throw new Error(`Duplicate migration number ${number} in ${label}: ${existing}, ${value}`);
}
seen.set(number, value);
}
}
function ensureStrictlyOrdered(values: string[], label: string) {
const sorted = [...values].sort();
for (let index = 0; index < values.length; index += 1) {
if (values[index] !== sorted[index]) {
throw new Error(
`${label} are out of order at position ${index}: expected ${sorted[index]}, found ${values[index]}`,
);
}
}
}
function ensureJournalMatchesFiles(migrationFiles: string[], journalTags: string[]) {
const journalFiles = journalTags.map((tag) => `${tag}.sql`);View on GitHub (pinned to 120ae5428f)
Solutions
- Renumber one of the duplicate migrations so each number is unique.
When it happens
Trigger: Thrown at packages/db/src/check-migration-numbering.ts:29 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18).
Data as JSON: /api/errors/7f841dd648e569ff.
Report an issue: GitHub.