projeto-hit/backend/src/models/UserOnlineTime.ts

45 lines
641 B
TypeScript
Raw Normal View History

2022-05-03 21:20:58 +00:00
import {
Table,
AutoIncrement,
Column,
CreatedAt,
UpdatedAt,
Model,
PrimaryKey,
HasMany,
ForeignKey,
BelongsTo
} from "sequelize-typescript";
import User from "./User";
@Table
class UserOnlineTime extends Model<UserOnlineTime> {
@PrimaryKey
@AutoIncrement
@Column
id: number;
@Column
status: string;
@Column
onlineTime: Date;
@CreatedAt
createdAt: Date;
@UpdatedAt
updatedAt: Date;
@ForeignKey(() => User)
@Column
userId: number;
@BelongsTo(() => User)
user: User;
}
export default UserOnlineTime;