feat(fulfillment,order): add created_by fields to fulfillment, return, claim, exchange (#8711)
what: - add created_by fields to fulfillment, return, claim, exchange
This commit is contained in:
@@ -1600,6 +1600,15 @@
|
||||
"nullable": true,
|
||||
"mappedType": "json"
|
||||
},
|
||||
"created_by": {
|
||||
"name": "created_by",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"metadata": {
|
||||
"name": "metadata",
|
||||
"type": "jsonb",
|
||||
@@ -1879,6 +1888,15 @@
|
||||
"default": "false",
|
||||
"mappedType": "boolean"
|
||||
},
|
||||
"created_by": {
|
||||
"name": "created_by",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"metadata": {
|
||||
"name": "metadata",
|
||||
"type": "jsonb",
|
||||
@@ -2279,6 +2297,15 @@
|
||||
"nullable": true,
|
||||
"mappedType": "json"
|
||||
},
|
||||
"created_by": {
|
||||
"name": "created_by",
|
||||
"type": "text",
|
||||
"unsigned": false,
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": true,
|
||||
"mappedType": "text"
|
||||
},
|
||||
"metadata": {
|
||||
"name": "metadata",
|
||||
"type": "jsonb",
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
|
||||
export class Migration20240821170920 extends Migration {
|
||||
async up(): Promise<void> {
|
||||
this.addSql(
|
||||
'alter table if exists "return" add column if not exists "created_by" text null;'
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
'alter table if exists "order_exchange" add column if not exists "created_by" text null;'
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
'alter table if exists "order_claim" add column if not exists "created_by" text null;'
|
||||
)
|
||||
}
|
||||
|
||||
async down(): Promise<void> {
|
||||
this.addSql(
|
||||
'alter table if exists "return" drop column if exists "created_by";'
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
'alter table if exists "order_exchange" drop column if exists "created_by";'
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
'alter table if exists "order_claim" drop column if exists "created_by";'
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -137,6 +137,9 @@ export default class OrderClaim {
|
||||
})
|
||||
transactions = new Collection<Transaction>(this)
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
created_by: string | null = null
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
|
||||
@@ -129,6 +129,9 @@ export default class OrderExchange {
|
||||
})
|
||||
transactions = new Collection<Transaction>(this)
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
created_by: string | null = null
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
|
||||
@@ -150,6 +150,9 @@ export default class Return {
|
||||
})
|
||||
transactions = new Collection<Transaction>(this)
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
created_by: string | null = null
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
metadata: Record<string, unknown> | null = null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user