const { DataTypes } = require("sequelize"); const seq = require("../db/seq"); const Account = seq.define("chicken_account", { // id 会被sequelize自动创建, 管理 username: { type: DataTypes.STRING, allowNull: false, unique: true, comment: "用户名, 唯一", }, password: { type: DataTypes.CHAR(64), allowNull: false, comment: "密码", }, role: { type: DataTypes.INTEGER, allowNull: false, comment: "用户角色, 0: 普通管理员; 1: 超级管理员", }, }); // 强制同步数据库(创建数据表) // Account.sync({ force: true }); module.exports = Account;