adejs/controllers/auth/models.js

15 lines
635 B
JavaScript
Raw Normal View History

2017-09-23 14:53:56 +02:00
const model = require('model');
2017-09-23 18:20:56 +02:00
var user = new model.BaseModel("authUser");
2017-09-23 14:53:56 +02:00
user.addField(new model.SerialField("id"));
2017-09-23 18:20:56 +02:00
user.addField(new model.TextField("username", {unique: true, notNull: true}));
user.addField(new model.TextField("email", {unique: true, notNull: true}));
user.addField(new model.BoolField("active", {notNull: true, default: false}));
user.addField(new model.TextField("activationKey"));
user.addField(new model.PasswordField("password", {notNull: true}));
2017-09-23 14:53:56 +02:00
user.addField(new model.SmallIntegerField("resources"));
2017-09-23 18:20:56 +02:00
user.addField(new model.SmallIntegerField("projectId"));
2017-09-23 14:53:56 +02:00
module.exports = model.createClass(user);
2017-09-23 18:20:56 +02:00