Genesis commit
This commit is contained in:
30
persistence/models/authenticationMethod.js
Normal file
30
persistence/models/authenticationMethod.js
Normal file
@@ -0,0 +1,30 @@
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("authenticationMethod", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
method: {
|
||||
type: DataTypes.ENUM,
|
||||
values: ['hd-auth', 'password', 'google-oauth']
|
||||
},
|
||||
order: {
|
||||
type: DataTypes.INTEGER,
|
||||
defaultValue: function() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}, {
|
||||
comment: "The supported authentication methods for a user of the system."
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
model.User = model.belongsTo(db.User);
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
Reference in New Issue
Block a user