peta-orm 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -285,6 +285,13 @@ All self-contained (inline SQLite, run directly):
285
285
  bun run examples/01-basic-setup.ts
286
286
  bun run examples/04-relations.ts
287
287
  bun run examples/07-soft-deletes.ts
288
+
289
+ # CLI — manage migrations
290
+ bun run bin/peta --help
291
+ bun run bin/peta migrate:init
292
+ bun run bin/peta migrate:generate CreateUsers
293
+ bun run bin/peta migrate:up
294
+ bun run bin/peta migrate:status
288
295
  ```
289
296
 
290
297
  | # | Example | Topic |
@@ -309,6 +316,7 @@ bun run examples/07-soft-deletes.ts
309
316
  | 18 | [advanced-queries](./examples/18-advanced-queries.ts) | groupBy/having, sum/avg/min/max, chunk, toSQL, updateMany |
310
317
  | 19 | [collections-deep](./examples/19-collections-deep.ts) | full Collection + Paginator API |
311
318
  | 20 | [advanced-relations](./examples/20-advanced-relations.ts) | HasManyThrough, polymorphic morphs, pivot extras |
319
+ | 21 | [migrations](./examples/21-migrations.ts) | MigrationRunner, MigrationGenerator, CLI |
312
320
 
313
321
  ---
314
322
 
@@ -325,6 +333,7 @@ bun run examples/07-soft-deletes.ts
325
333
  | **Hooks** | `HookManager`, `on()`, `off()`, `trigger()` | `src/hooks/lifecycle.ts` |
326
334
  | **Paginator** | `Paginator`, `.paginate()` | `src/pagination/Paginator.ts` |
327
335
  | **Errors** | `ModelNotFoundError`, `RelationNotFoundError`, `ValidationError`, `DatabaseError` | `src/errors/errors.ts` |
336
+ | **Migrations** | `MigrationRunner`, `MigrationGenerator`, `defineConfig`, CLI (`peta migrate:*`) | `src/migrations/index.ts` (import from `peta-orm/migrator`) |
328
337
 
329
338
  ---
330
339
 
package/bin/peta ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ import { run } from "../src/migrations/cli"
3
+ await run()