Fix db relations, add sample data, show categories in frontend menu
This commit is contained in:
14
software/backend/models/category.model.ts
Normal file
14
software/backend/models/category.model.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Table, Column, Model, BelongsTo, ForeignKey, HasMany } from 'sequelize-typescript';
|
||||
import { Product } from './product.model';
|
||||
|
||||
@Table
|
||||
export class Category extends Model {
|
||||
@Column
|
||||
name: string
|
||||
|
||||
@Column
|
||||
icon: string
|
||||
|
||||
@HasMany(() => Product)
|
||||
product: Product
|
||||
}
|
||||
Reference in New Issue
Block a user