UNPKG

@tomei/product

Version:

NestJS package for product module

44 lines (36 loc) 737 B
import { BelongsTo, Column, CreatedAt, DataType, ForeignKey, Model, Table, UpdatedAt, } from 'sequelize-typescript'; import { ProductModel } from './product.entity'; @Table({ tableName: 'product_Tag' }) export class ProductTagModel extends Model { @Column({ type: DataType.STRING, allowNull: false, primaryKey: true, }) TagId: string; @ForeignKey(() => ProductModel) @Column({ allowNull: false, type: DataType.STRING, }) ProductId: string; @Column({ type: DataType.STRING(30) }) Group: string; @Column({ type: DataType.STRING(100) }) Name: string; @CreatedAt CreatedAt: Date; @UpdatedAt UpdatedAt: Date; @BelongsTo(() => ProductModel) Product: ProductModel; }