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.
 
 
 
 
 

42 lines
920 B

import {sequelize, connect} from "@/db/index"
import {DataTypes} from "sequelize";
// 全自定义写法
// const User = sequelize.define('User', {
// id: {
// type: DataTypes.STRING(50),
// primaryKey: true
// },
// username: {
// type: DataTypes.STRING,
// allowNull: false
// },
// password: {
// type: DataTypes.STRING,
// allowNull: false
// },
// createdAt: DataTypes.BIGINT,
// updatedAt: DataTypes.BIGINT,
// version: DataTypes.BIGINT
// }, {
// timestamps: false
// });
/**
* 用户表:
* 用户名-密码-邮箱-性别-婚姻状况
*/
const User = sequelize.define('User', {
username: {
type: DataTypes.STRING,
allowNull: false
},
password: {
type: DataTypes.STRING,
allowNull: false
},
email: {
type: DataTypes.STRING,
}
}, {
});
export default User;