Basic user CR

This commit is contained in:
2024-06-21 16:10:29 +08:00
parent 50fc73713e
commit 6f378d25a1
7 changed files with 331 additions and 20 deletions

36
server/models/User.js Normal file
View File

@@ -0,0 +1,36 @@
module.exports = (sequelize, DataTypes) => {
const User = sequelize.define(
"User",
{
id: {
type: DataTypes.INTEGER(),
allowNull: false,
primaryKey: true,
},
firstName: {
type: DataTypes.STRING(100),
allowNull: false,
},
lastName: {
type: DataTypes.STRING(100),
allowNull: false,
},
email: {
type: DataTypes.STRING(69),
allowNull: false,
},
phoneNumber: {
type: DataTypes.STRING(8),
allowNull: false,
},
passwordHash: {
type: DataTypes.STRING(255),
allowNull: false,
},
},
{
tableName: "users",
}
);
return User;
};