@bunnykit/orm 0.1.10 → 0.1.11

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.
Files changed (2) hide show
  1. package/README.md +19 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -394,6 +394,25 @@ await Schema.create("posts", (table) => {
394
394
  });
395
395
  ```
396
396
 
397
+ The foreign key call adds the constraint only. Define the local column first, and make its type match the referenced column:
398
+
399
+ ```ts
400
+ await Schema.create("users", (table) => {
401
+ table.uuid("id").primary();
402
+ table.string("email").unique();
403
+ table.timestamps();
404
+ });
405
+
406
+ await Schema.create("posts", (table) => {
407
+ table.increments("id");
408
+ table.uuid("user_id");
409
+ table.foreign("user_id").references("id").on("users").onDelete("cascade");
410
+ table.string("title");
411
+ table.text("content");
412
+ table.timestamps();
413
+ });
414
+ ```
415
+
397
416
  ---
398
417
 
399
418
  ## Query Builder
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunnykit/orm",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "An Eloquent-inspired ORM for Bun's native SQL client supporting SQLite, MySQL, and PostgreSQL.",
5
5
  "license": "MIT",
6
6
  "packageManager": "bun@1.3.12",