Skip to content

Manufacturing orders

Products, work orders and the materials each order consumes.

related volume small ManufacturingProductsRelationships
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table products rows 6 (
  id   int64 autoincrement primarykey
  name text words(maxWords: 2)
)

table work_orders rows 12 per(products, 1, 3) (
  id         int64 autoincrement primarykey
  product_id int64 fk(products.id)
  quantity   int64 integer(min: 1, max: 100)
  status     text enum(values: ["planned", "in_progress", "completed"])
)

table materials rows 20 per(work_orders, 1, 3) (
  id            int64 autoincrement primarykey
  work_order_id int64 fk(work_orders.id)
  product_id    int64 fk(products.id)
  quantity      int64 integer(min: 1, max: 50)
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

Manufacturing orders

A multi-table recipe that generates manufacturing orders: products, work orders and the materials each order consumes.

What it demonstrates

  • Relationships — work_orders references products, and materials references both work_orders and products.
  • Row distribution — per(...) groups work orders per product and materials per work order.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output.

The recipe outputs CSV files: products.csv, work_orders.csv and materials.csv.

Guarantees

Every foreign key names an existing parent row and per(...) grouping holds. Values are synthetic and not a balanced bill of materials.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

wordsintegerenumfkperautoincrementprimary-key