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.
185 lines
4.4 KiB
185 lines
4.4 KiB
/* eslint-disable*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const sequelize = dc.orm;
|
|
const ReportInstance = sequelize.define("reportInstance", {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Primary key",
|
|
primaryKey: true,
|
|
field: "id",
|
|
autoIncrement: true
|
|
},
|
|
templateId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Template id",
|
|
primaryKey: false,
|
|
field: "template_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportTemplate"
|
|
}
|
|
},
|
|
generationBatchId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Generation batch id",
|
|
primaryKey: false,
|
|
field: "generation_batch_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportGenerationBatch"
|
|
}
|
|
},
|
|
schemaVersionId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Schema version id",
|
|
primaryKey: false,
|
|
field: "schema_version_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportSchemaVersion"
|
|
}
|
|
},
|
|
name: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Instance name",
|
|
primaryKey: false,
|
|
field: "name",
|
|
autoIncrement: false
|
|
},
|
|
type: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Instance type",
|
|
primaryKey: false,
|
|
field: "type",
|
|
autoIncrement: false
|
|
},
|
|
dataSourceId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Data source id",
|
|
primaryKey: false,
|
|
field: "data_source_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportDataSource"
|
|
}
|
|
},
|
|
createdBy: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Creator",
|
|
primaryKey: false,
|
|
field: "created_by",
|
|
autoIncrement: false
|
|
},
|
|
departmentId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Department id",
|
|
primaryKey: false,
|
|
field: "department_id",
|
|
autoIncrement: false
|
|
},
|
|
sourceFileUrl: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Source docx url",
|
|
primaryKey: false,
|
|
field: "source_file_url",
|
|
autoIncrement: false
|
|
},
|
|
sourceFileName: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Source docx filename",
|
|
primaryKey: false,
|
|
field: "source_file_name",
|
|
autoIncrement: false
|
|
},
|
|
batchDimensionKey: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Batch dimension key snapshot",
|
|
primaryKey: false,
|
|
field: "batch_dimension_key",
|
|
autoIncrement: false
|
|
},
|
|
batchDimensionLabel: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Batch dimension label snapshot",
|
|
primaryKey: false,
|
|
field: "batch_dimension_label",
|
|
autoIncrement: false
|
|
},
|
|
batchTimeStart: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Batch time start snapshot",
|
|
primaryKey: false,
|
|
field: "batch_time_start",
|
|
autoIncrement: false
|
|
},
|
|
batchTimeEnd: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Batch time end snapshot",
|
|
primaryKey: false,
|
|
field: "batch_time_end",
|
|
autoIncrement: false
|
|
},
|
|
createdAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
|
comment: "Created time",
|
|
primaryKey: false,
|
|
field: "created_at",
|
|
autoIncrement: false
|
|
},
|
|
exportedAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Exported time",
|
|
primaryKey: false,
|
|
field: "exported_at",
|
|
autoIncrement: false
|
|
}
|
|
}, {
|
|
tableName: "report_instance",
|
|
comment: "Report instance table",
|
|
indexes: []
|
|
});
|
|
dc.models.ReportInstance = ReportInstance;
|
|
return ReportInstance;
|
|
};
|
|
|