add the redis

This commit is contained in:
Isuru Bimsara
2026-08-20 15:16:17 +05:30
parent c3d9f899a1
commit 621d348eb1
6 changed files with 244 additions and 262 deletions
@@ -1,46 +0,0 @@
//app/models/user/emailVerification.model.js
module.exports = (sequelize, DataTypes) => {
const EmailVerification = sequelize.define(
"EmailVerification",
{
id: {
type: DataTypes.STRING,
primaryKey: true,
},
user_id: {
type: DataTypes.STRING,
allowNull: false,
},
tokenHash: {
type: DataTypes.STRING,
allowNull: false,
},
expiresAt: {
type: DataTypes.DATE,
allowNull: false,
},
usedAt: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
},
{
tableName: "email_verifications",
timestamps: true,
}
);
EmailVerification.associate = (db) => {
EmailVerification.belongsTo(db.User, {
foreignKey: "user_id",
as: "user",
});
};
return EmailVerification;
};
-4
View File
@@ -72,10 +72,6 @@ module.exports = (sequelize, DataTypes) => {
as: "profile",
});
User.hasMany(db.EmailVerification, {
foreignKey: "user_id",
as: "emailVerifications",
});
};
return User;