Members
Object
# inner constant user
Example
{
user_id: {
type: DataTypes.INTEGER,
primaryKey: boolean,
allowNull: boolean,
autoIncrement: boolean,
validate: { isInteger: boolean }
},
uuid: {
type: DataTypes.UUID,
unique: boolean,
allowNull: boolean,
defaultValue: DataTypes.UUIDV4,
validate: { isUUID: number }
},
first_name: {
type: DataTypes.STRING,
allowNull: boolean,
validate: { notEmpty: boolean }
},
last_name: {
type: DataTypes.STRING,
allowNull: boolean,
validate: { notEmpty: boolean }
},
birth_date: {
type: DataTypes.DATE,
allowNull: boolean,
validate: { isAfter: string }
},
email: {
type: DataTypes.STRING,
unique: { args: boolean, msg: string },
allowNull: boolean,
validate: { isEmail: boolean }
},
password: {
type: DataTypes.STRING,
allowNull: boolean
},
address_street: {
type: DataTypes.STRING,
allowNull: boolean
},
address_city: {
type: DataTypes.STRING,
allowNull: boolean
},
address_postal_code: {
type: DataTypes.STRING,
allowNull: boolean
},
gender: {
type: DataTypes.STRING,
allowNull: boolean
},
region: {
type: DataTypes.STRING,
allowNull: boolean
}
}
Methods
# static define(sequelize, name)
Define the model
Parameters:
| Name | Type | Description |
|---|---|---|
sequelize |
Sequelize
|
|
name |
string
|
The file name used for the definition |