Add all database tables with relations
This commit is contained in:
24
software/backend/models/users.model.ts
Normal file
24
software/backend/models/users.model.ts
Normal 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[]
|
||||
}
|
||||
Reference in New Issue
Block a user