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.
51 lines
1.0 KiB
51 lines
1.0 KiB
/* eslint-disable*/
|
|
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const sequelize = dc.orm;
|
|
const UserPost = sequelize.define("userPost", {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: true,
|
|
field: "id",
|
|
autoIncrement: true,
|
|
unique: "user_post_id_uindex"
|
|
},
|
|
userId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "user_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "tUser"
|
|
}
|
|
},
|
|
postId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "post_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "tPost"
|
|
}
|
|
}
|
|
}, {
|
|
tableName: "user_post",
|
|
comment: "",
|
|
indexes: []
|
|
});
|
|
dc.models.UserPost = UserPost;
|
|
return UserPost;
|
|
};
|