Compare commits

..

1 Commits
v0.1.1 ... main

Author SHA1 Message Date
9c406ac3a0 fix: explain migration_conflict with the server detail and the fix; bunx line in README
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-17 20:19:20 +03:00
2 changed files with 16 additions and 2 deletions

View File

@ -68,7 +68,8 @@ scribase-migrate clerk --to <org>/<project> --secret-key <sk_...>
scribase-migrate resend --api-key <re_...> --out resend-export.json
```
Prefix each with `npx --yes git+https://rithub.dev/caelum0x/scribase-migrate.git`, or clone the
Prefix each with `npx --yes git+https://rithub.dev/caelum0x/scribase-migrate.git` (Bun:
`bunx -p git+https://rithub.dev/caelum0x/scribase-migrate.git scribase-migrate`), or clone the
repo and run `node bin/scribase-migrate.mjs`. `--help` prints every flag.
| Source | Postgres schema + data | Auth users / passwords | Storage | Notes |

View File

@ -289,7 +289,20 @@ async function runClerk(values, apiUrl, serviceRoleKey) {
await writeResult(values, { exported: users.length, ...result });
}
/** The control plane's own detail line, plus the one fix that applies, for errors a new user hits first. */
function explain(error) {
const detail = error?.problem?.detail;
const lines = [detail ? `${error.message} (${detail})` : error.message];
if (error?.code === 'migration_conflict') {
lines.push(
'This environment already has migrations that are not in ./supabase/migrations here. ' +
'Run from the folder that holds them (your app repo), or pick a new environment in --to.',
);
}
return lines;
}
main().catch((error) => {
process.stderr.write(`scribase-migrate: ${error.message}\n`);
for (const line of explain(error)) process.stderr.write(`scribase-migrate: ${line}\n`);
process.exitCode = 1;
});