Add all database tables with relations
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import { Table, Column, Model, PrimaryKey, AutoIncrement } from 'sequelize-typescript';
|
||||
import { Table, Column, Model, BelongsTo, ForeignKey } from 'sequelize-typescript';
|
||||
import { Products } from './products.model';
|
||||
|
||||
@Table
|
||||
export class Categories extends Model {
|
||||
@Column
|
||||
name: string
|
||||
|
||||
@ForeignKey(() => Products)
|
||||
productId: number
|
||||
|
||||
@BelongsTo(() => Products)
|
||||
product: Products
|
||||
}
|
||||
Reference in New Issue
Block a user