UNPKG

@tomei/product

Version:

NestJS package for product module

34 lines (30 loc) 622 B
import { Column, Table, Model, DataType, ForeignKey, BelongsTo, PrimaryKey, } from 'sequelize-typescript'; import { ProductModel } from './product.entity'; @Table({ tableName: 'product_Brand', timestamps: false, createdAt: false, updatedAt: false, }) export class ProductBrandModel extends Model { @PrimaryKey @Column({ allowNull: false, unique: true, type: DataType.STRING(30) }) Brand: string; @PrimaryKey @ForeignKey(() => ProductModel) @Column({ allowNull: false, type: DataType.STRING, }) ProductId: string; @BelongsTo(() => ProductModel) Product: ProductModel; }