chore(order): custom display id (#14024)

* chore(order): Accept a custom display generator option

* chore(order): Accept a custom display generator option

* wip

* wip

* finalize

* Create tricky-olives-battle.md

* fields

* changeset

* update integration tests

* update migrations

* fix changeset
This commit is contained in:
Adrien de Peretti
2025-11-18 10:17:46 +01:00
committed by GitHub
parent 0a0c2f41d8
commit 6746fecd72
29 changed files with 479 additions and 260 deletions
@@ -11,6 +11,7 @@ const _Order = model
.define("Order", {
id: model.id({ prefix: "order" }).primaryKey(),
display_id: model.autoincrement().searchable(),
custom_display_id: model.text().nullable(),
region_id: model.text().nullable(),
customer_id: model.text().nullable(),
version: model.number().default(1),
@@ -71,6 +72,12 @@ const _Order = model
unique: false,
where: "deleted_at IS NULL",
},
{
name: "IDX_order_custom_display_id",
on: ["custom_display_id"],
unique: true,
where: "deleted_at IS NULL",
},
{
name: "IDX_order_region_id",
on: ["region_id"],