diff options
Diffstat (limited to 'src/routers/vault/models/evol/login.js')
-rw-r--r-- | src/routers/vault/models/evol/login.js | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/routers/vault/models/evol/login.js b/src/routers/vault/models/evol/login.js new file mode 100644 index 0000000..be37f07 --- /dev/null +++ b/src/routers/vault/models/evol/login.js @@ -0,0 +1,94 @@ +const Sequelize = require("sequelize"); // from npm registry + +module.exports = { + fields: { + accountId: { + type: Sequelize.INTEGER.UNSIGNED, + primaryKey: true, + autoIncrement: true, + allowNull: false, + }, + userid: { // username + type: Sequelize.STRING(23), + allowNull: false, + defaultValue: "", + }, + userPass: { // plaintext + type: Sequelize.STRING(32), + allowNull: false, + defaultValue: "", + }, + sex: { // NOTE: we must exclude S + type: Sequelize.ENUM("M", "F", "S"), // TODO: add N when evol-hercules supports it + allowNull: false, + defaultValue: "M", // TODO: change to N + }, + email: { // limited email length + type: Sequelize.STRING(39), + allowNull: false, + defaultValue: "", + }, + groupId: { + type: Sequelize.INTEGER, + allowNull: false, + defaultValue: 0, + }, + state: { + type: Sequelize.INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, + }, + unbanTime: { + type: Sequelize.INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, + }, + expirationTime: { + type: Sequelize.INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, + }, + logincount: { + type: Sequelize.INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, + }, + lastlogin: { + type: Sequelize.DATE, + allowNull: true, + }, + lastIp: { + type: Sequelize.STRING(100), + allowNull: false, + defaultValue: "", + }, + birthdate: { + type: Sequelize.DATE, + allowNull: true, + }, + characterSlots: { + type: Sequelize.INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, // 0 means MAX_CHARS(12) + }, + pincode: { + type: Sequelize.STRING(4), // TODO: use this for TOTP + allowNull: false, + defaultValue: "", + }, + pincodeChange: { + type: Sequelize.INTEGER.UNSIGNED, + allowNull: false, + defaultValue: 0, + }, + }, + options: { + engine: "InnoDB", + initialAutoIncrement: 2000000, + indexes: [ + { + fields: ["userid"], + } + ] + } +}; |