This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/api/models/users.js

46 lines
858 B
JavaScript
Raw Normal View History

2020-08-03 12:04:07 +02:00
const Sequelize = require('sequelize')
const sequelize = require('../assets/utils/database')
2020-03-25 16:23:43 +01:00
module.exports = sequelize.define('user', {
2020-08-03 12:04:07 +02:00
name: {
type: Sequelize.STRING,
allowNull: false
},
email: {
type: Sequelize.STRING,
allowNull: false
},
password: {
type: Sequelize.STRING,
allowNull: false
},
biography: {
type: Sequelize.TEXT,
defaultValue: ''
},
logo: {
type: Sequelize.STRING,
defaultValue: '/images/users/default.png'
},
isConfirmed: {
type: Sequelize.BOOLEAN,
defaultValue: false
},
isPublicEmail: {
type: Sequelize.BOOLEAN,
defaultValue: false
},
isAdmin: {
type: Sequelize.BOOLEAN,
defaultValue: false
},
tempToken: {
type: Sequelize.TEXT,
allowNull: true
},
tempExpirationToken: {
type: Sequelize.DATE,
allowNull: true
}
})