migration
This commit is contained in:
@@ -22,7 +22,7 @@ import { OrderStatusEnum } from '../interface/order.interface';
|
||||
@Entity({ tableName: 'orders' })
|
||||
@Index({ properties: ['user'] })
|
||||
export class Order extends BaseEntity {
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt' | 'orderNumber'|'paidAmount'|'balance';
|
||||
[OptionalProps]?: 'createdAt' | 'deletedAt' | 'orderNumber' | 'paidAmount' | 'balance';
|
||||
|
||||
@PrimaryKey({ type: 'string', columnType: 'char(26)' })
|
||||
id: string = ulid()
|
||||
@@ -46,8 +46,12 @@ export class Order extends BaseEntity {
|
||||
@ManyToOne(() => Admin, { nullable: true })
|
||||
creator?: Admin
|
||||
|
||||
@Property({ type: 'int', defaultRaw: `nextval('order_number_seq')` })
|
||||
orderNumber!: number;
|
||||
@Property({
|
||||
type: 'int',
|
||||
autoincrement: true
|
||||
// defaultRaw: `nextval('order_number_seq')`
|
||||
})
|
||||
orderNumber: number;
|
||||
|
||||
|
||||
@Property({ type: 'int', nullable: true })
|
||||
|
||||
Reference in New Issue
Block a user