4 changed files with 90 additions and 45 deletions
@ -0,0 +1,40 @@ |
|||||
|
/* eslint-disable*/ |
||||
|
'use strict'; |
||||
|
|
||||
|
module.exports = dc => { |
||||
|
const DataTypes = dc.ORM; |
||||
|
const sequelize = dc.orm; |
||||
|
const AxProject = sequelize.define("axProject", { |
||||
|
id: { |
||||
|
type: DataTypes.INTEGER, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: true, |
||||
|
field: "id", |
||||
|
autoIncrement: false, |
||||
|
unique: "ax_project_id_uindex" |
||||
|
}, |
||||
|
name: { |
||||
|
type: DataTypes.STRING, |
||||
|
allowNull: false, |
||||
|
defaultValue: null, |
||||
|
comment: null, |
||||
|
primaryKey: false, |
||||
|
field: "name", |
||||
|
autoIncrement: false |
||||
|
} |
||||
|
}, { |
||||
|
tableName: "ax_project", |
||||
|
comment: "", |
||||
|
indexes: [] |
||||
|
}); |
||||
|
|
||||
|
const Nvr = dc.models.Nvr; |
||||
|
|
||||
|
// Nvr.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' });
|
||||
|
// User.hasMany(Nvr, { foreignKey: 'userId', sourceKey: 'id' });
|
||||
|
|
||||
|
dc.models.AxProject = AxProject; |
||||
|
return AxProject; |
||||
|
}; |
Loading…
Reference in new issue