You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
598 B
TypeScript
47 lines
598 B
TypeScript
import {
|
|
Column,
|
|
Model,
|
|
Table,
|
|
CreatedAt,
|
|
UpdatedAt,
|
|
PrimaryKey,
|
|
DataType,
|
|
NotEmpty,
|
|
Default,
|
|
HasMany,
|
|
} from 'sequelize-typescript';
|
|
import { Rank } from '../rank/rank.model';
|
|
|
|
@Table({
|
|
timestamps: true,
|
|
})
|
|
export class User extends Model {
|
|
@PrimaryKey
|
|
@Default(DataType.UUIDV4)
|
|
@Column(DataType.STRING)
|
|
id: string;
|
|
|
|
@NotEmpty
|
|
@Column
|
|
name: string;
|
|
|
|
@NotEmpty
|
|
@Column
|
|
email: string;
|
|
|
|
@NotEmpty
|
|
@Column
|
|
password: string;
|
|
|
|
@CreatedAt
|
|
@Column
|
|
createdAt: Date;
|
|
|
|
@UpdatedAt
|
|
@Column
|
|
updatedAt: Date;
|
|
|
|
@HasMany(() => Rank)
|
|
ranks: Rank[];
|
|
}
|