Skip to content

Commit 46d14df

Browse files
committed
docs/polish(#242): precise apply-pending vs --apply wording; usage synopsis; test assertion
1 parent 5bf46e7 commit 46d14df

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/features/migrations-and-drift.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ configured in `metaobjects.config.ts` (typically `./migrations/<timestamp>__<slu
5858
**`meta migrate apply-pending`** replays the committed migration files against `--db`
5959
in order, ledger-tracked (`_metaobjects_migrations`) and transactional — with **no
6060
diff and no metadata load**. It is the way to provision a fresh or CI database from the
61-
committed migrations: `meta migrate --apply` is diff-first and cannot bootstrap an empty
62-
DB, whereas `apply-pending` just runs the pending files (idempotent; `--dry-run` lists
63-
what would run). postgres/sqlite only — on D1 use `wrangler d1 migrations apply`.
61+
committed migrations. `meta migrate --apply`, by contrast, is diff-first — it authors a
62+
new migration from the metadata-vs-DB diff before applying it. `apply-pending` just runs
63+
the pending already-committed files, making it idempotent; `--dry-run` lists what would
64+
run. postgres/sqlite only — on D1 use `wrangler d1 migrations apply`.
6465

6566
#### D1 limitation: rebuilding a foreign-key-referenced table
6667

server/typescript/packages/cli/src/commands/migrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import { tokensToAllowOptions, describeChange } from "../lib/allow.js";
5151
const MIGRATE_HELP_TEXT = `meta migrate — diff metadata vs live DB; emit migration SQL files
5252
5353
USAGE:
54-
meta migrate [baseline] [flags]
54+
meta migrate [baseline|apply-pending] [flags]
5555
5656
SUBCOMMANDS:
5757
baseline Snapshot an EXISTING database's schema as the reference point

server/typescript/packages/cli/test/migrate-args.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ describe("parseMigrateArgs — apply-pending subcommand", () => {
5858
});
5959

6060
test("an unknown subcommand still throws, now listing apply-pending", () => {
61-
expect(() => parseMigrateArgs(["bogus"])).toThrow(/unknown migrate subcommand/);
61+
expect(() => parseMigrateArgs(["bogus"])).toThrow(/apply-pending/);
6262
});
6363
});

0 commit comments

Comments
 (0)