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
1 year ago
|
/* eslint-disable*/
|
||
|
'use strict';
|
||
|
|
||
|
module.exports = dc => {
|
||
|
const DataTypes = dc.ORM;
|
||
|
const sequelize = dc.orm;
|
||
|
const UserResource = sequelize.define("userResource", {
|
||
|
id: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: true,
|
||
|
field: "id",
|
||
|
autoIncrement: true,
|
||
|
},
|
||
|
userId: {
|
||
|
type: DataTypes.INTEGER,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
|
field: "user_id",
|
||
|
autoIncrement: false,
|
||
|
references: {
|
||
|
key: "id",
|
||
|
model: "t_user"
|
||
|
}
|
||
|
},
|
||
|
resourceCode: {
|
||
|
type: DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
defaultValue: null,
|
||
|
comment: null,
|
||
|
primaryKey: false,
|
||
|
field: "resource_code",
|
||
|
autoIncrement: false,
|
||
|
references: {
|
||
|
key: "code",
|
||
|
model: "t_resource"
|
||
|
}
|
||
|
}
|
||
|
}, {
|
||
|
tableName: "t_user_resource",
|
||
|
comment: "",
|
||
|
indexes: []
|
||
|
});
|
||
|
|
||
|
dc.models.UserResource = UserResource;
|
||
|
return UserResource;
|
||
|
};
|