我有一个简单的模型:
export default (sequelize, DataTypes) => {
const module = sequelize.define(
'module',
{
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
name: {
type: DataTypes.STRING(50),
allowNull: false,
unique: true,
},
},
{
tableName: 'module',
createdAt: true,
updatedAt: true,
timestamps: true,
underscored: true,
paranoid: true,
},
);
return module;
};
我希望表“模块”看起来像这样:
id integer NOT NULL DEFAULT nextval('module_id_seq'::regclass),
name character varying(50) NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
deleted_at timestamp with time zone,
但是我得到这个:
id integer NOT NULL DEFAULT nextval('module_id_seq'::regclass),
name character varying(50) NOT NULL,
"true" timestamp with time zone NOT NULL,
deleted_at timestamp with time zone,
有什么主意如何解决此问题以及为什么要续集创建“ true”表?