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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user