Add all database tables with relations

This commit is contained in:
2024-09-04 17:06:41 +02:00
parent 7338bb216a
commit cfd1d29302
6 changed files with 114 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
import { Table, Column, Model, HasMany } from 'sequelize-typescript';
import { Orders } from './orders.model';
@Table
export class Users extends Model {
@Column
username: string
@Column
password: string
@Column
address: string
@Column
firstName: string
@Column
lastName: string
// Relations
@HasMany(() => Orders)
orders: Orders[]
}