You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
666 B
40 lines
666 B
import { Column, Table, Model, DataType } from "sequelize-typescript"; |
|
|
|
@Table |
|
export class User extends Model<User> { |
|
@Column({ unique: true }) |
|
email: string; |
|
|
|
@Column |
|
password: string; |
|
|
|
@Column({ |
|
type: DataType.ENUM("admin", "user"), |
|
defaultValue: "user", |
|
allowNull: false, |
|
}) |
|
role: string; |
|
|
|
@Column |
|
firstName: string; |
|
|
|
@Column |
|
lastName: string; |
|
|
|
@Column({ unique: true }) |
|
username: string; |
|
|
|
@Column({ unique: true, allowNull: false }) |
|
phoneNumber: string; |
|
|
|
@Column({ |
|
type: DataType.ENUM("male", "female"), |
|
allowNull: false, |
|
}) |
|
gender: string; |
|
|
|
} |
|
export enum Gender { |
|
Male = "male", |
|
Female = "female", |
|
}
|
|
|