石墨消解仪后端用nodejs编写,与嵌入式端交互和前端交互均用ws
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
630 B

2 years ago
2 years ago
2 years ago
  1. const { DataTypes } = require("sequelize");
  2. const seq = require("../db/seq");
  3. const Account = seq.define("chicken_account", {
  4. // id 会被sequelize自动创建, 管理
  5. username: {
  6. type: DataTypes.STRING,
  7. allowNull: false,
  8. unique: true,
  9. comment: "用户名, 唯一",
  10. },
  11. password: {
  12. type: DataTypes.CHAR(64),
  13. allowNull: false,
  14. comment: "密码",
  15. },
  16. role: {
  17. type: DataTypes.INTEGER,
  18. allowNull: false,
  19. comment: "用户角色, 0: 普通管理员; 1: 超级管理员",
  20. },
  21. });
  22. // 强制同步数据库(创建数据表)
  23. // Account.sync({ force: true });
  24. module.exports = Account;