UNPKG

@tomei/product

Version:

NestJS package for product module

47 lines (38 loc) 870 B
import { Model, Table, Column, DataType, ForeignKey, CreatedAt, UpdatedAt, BelongsTo, } from 'sequelize-typescript'; import { ProductModel } from './product.entity'; @Table({ tableName: 'product_Material' }) export class ProductMaterialModel extends Model { @Column({ primaryKey: true, allowNull: false }) MaterialId: string; @ForeignKey(() => ProductModel) @Column({ allowNull: false, type: DataType.STRING, }) ProductId: string; @Column({ allowNull: false, type: DataType.STRING(50) }) Material: string; @Column({ allowNull: true, type: DataType.STRING(100) }) Type: string; @Column({ allowNull: false, type: DataType.ENUM('Y', 'N'), defaultValue: 'N', }) IsMainYN: string; @CreatedAt CreatedAt: Date; @UpdatedAt UpdatedAt: Date; @BelongsTo(() => ProductModel) Product: ProductModel; }