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.
79 lines
1.8 KiB
79 lines
1.8 KiB
/* eslint-disable*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const sequelize = dc.orm;
|
|
const ReportTemplateChapter = sequelize.define("reportTemplateChapter", {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Primary key",
|
|
primaryKey: true,
|
|
field: "id",
|
|
autoIncrement: true
|
|
},
|
|
templateId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Template id",
|
|
primaryKey: false,
|
|
field: "template_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportTemplate"
|
|
}
|
|
},
|
|
parentId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Parent chapter id",
|
|
primaryKey: false,
|
|
field: "parent_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportTemplateChapter"
|
|
}
|
|
},
|
|
title: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Chapter title",
|
|
primaryKey: false,
|
|
field: "title",
|
|
autoIncrement: false
|
|
},
|
|
position: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Chapter position",
|
|
primaryKey: false,
|
|
field: "position",
|
|
autoIncrement: false
|
|
},
|
|
createdAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
|
comment: "Created time",
|
|
primaryKey: false,
|
|
field: "created_at",
|
|
autoIncrement: false
|
|
}
|
|
}, {
|
|
tableName: "report_template_chapter",
|
|
comment: "Report template chapter table",
|
|
indexes: []
|
|
});
|
|
dc.models.ReportTemplateChapter = ReportTemplateChapter;
|
|
return ReportTemplateChapter;
|
|
};
|
|
|
|
|