Archived
1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
kfet/models/user.js

30 lines
602 B
JavaScript
Raw Normal View History

2020-05-29 11:59:25 +02:00
"use strict";
module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
2020-05-29 19:44:12 +02:00
allowNull: false,
unique: true
2020-05-29 11:59:25 +02:00
},
passwordHash: {
type: DataTypes.STRING
},
firstName: {
type: DataTypes.STRING,
2020-05-29 19:44:12 +02:00
allowNull: false,
unique: "userFullName"
2020-05-29 11:59:25 +02:00
},
lastName: {
type: DataTypes.STRING,
2020-05-29 19:44:12 +02:00
allowNull: false,
unique: "userFullName"
2020-05-29 11:59:25 +02:00
}
}, {
tableName: "Users"
});
User.associate = function(models) {
// associations can be defined here
};
return User;
};