feat(order): Add display_id to order table (#7242)

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
Oli Juhl
2024-05-05 19:43:13 +02:00
committed by GitHub
parent 5443c69794
commit cf9605fe6f
6 changed files with 633 additions and 132 deletions

View File

@@ -28,6 +28,12 @@ type OptionalOrderProps =
| "billing_address"
| DAL.EntityDateColumns
const DisplayIdIndex = createPsqlIndexStatementHelper({
tableName: "order",
columns: "display_id",
where: "deleted_at IS NOT NULL",
})
const RegionIdIndex = createPsqlIndexStatementHelper({
tableName: "order",
columns: "region_id",
@@ -83,6 +89,10 @@ export default class Order {
@PrimaryKey({ columnType: "text" })
id: string
@Property({ autoincrement: true, primary: false })
@DisplayIdIndex.MikroORMIndex()
display_id: number
@Property({
columnType: "text",
nullable: true,