1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// app/models/userData.ts
import { DataTypes } from "sequelize";
import { sequelize } from "../config/database";
export const UserData = sequelize.define(
"UserData",
{
id: {
type: DataTypes.BIGINT,
primaryKey: true,
autoIncrement: true,
},
username: {
type: DataTypes.STRING(100),
allowNull: false,
unique: true,
},
user_password: {
type: DataTypes.STRING(255),
allowNull: false,
},
access_token: {
type: DataTypes.STRING(255),
allowNull: true,
},
access_token_expiry_time: {
type: DataTypes.DATE,
allowNull: true,
},
created_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
},
updated_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
},
},
{
tableName: "user_data",
timestamps: true,
createdAt: "created_at",
updatedAt: "updated_at",
underscored: true,
}
);
|