| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- const moment = require('moment');
- module.exports = (sequelize, DataTypes) =>
- sequelize.define('user', {
- id: {
- type: DataTypes.INTEGER,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- realName: {
- type: DataTypes.STRING(64),
- allowNull: false
- },
- organization: {
- type: DataTypes.STRING(64),
- allowNull: false,
- defaultValue: '南京大学'
- },
- jobNumber: {
- type: DataTypes.STRING(64),
- allowNull: false
- },
- certificate: {
- type: DataTypes.STRING(512),
- allowNull: false,
- defaultValue: ""
- },
- phone: {
- type: DataTypes.STRING(64),
- allowNull: false,
- unique: 'column'
- },
- email: {
- type: DataTypes.STRING(512),
- allowNull: false,
- defaultValue: "xxxxx@xxx.com"
- },
- uid: {
- type: DataTypes.INTEGER,
- allowNull: false,
- unique: 'column'
- },
- createdTime: {
- type: DataTypes.DATE,
- allowNull: false,
- get() {
- return moment(this.getDataValue('createdTime')).format('YYYY-MM-DD HH:mm:ss');
- }
- },
- state: {
- type: DataTypes.ENUM,
- values: ['identifying', 'identified', 'rejected'],
- allowNull: false,
- defaultValue: 'identifying'
- },
- }, {
- tableName: 'teacher'
- });
|