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.
132 lines
3.1 KiB
132 lines
3.1 KiB
/* eslint-disable*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const sequelize = dc.orm;
|
|
const ReportGenerationBatchItem = sequelize.define("reportGenerationBatchItem", {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Primary key",
|
|
primaryKey: true,
|
|
field: "id",
|
|
autoIncrement: true
|
|
},
|
|
batchId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Batch id",
|
|
primaryKey: false,
|
|
field: "batch_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportGenerationBatch"
|
|
}
|
|
},
|
|
itemIndex: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Item index in batch",
|
|
primaryKey: false,
|
|
field: "item_index",
|
|
autoIncrement: false
|
|
},
|
|
dimensionKey: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "Dimension key",
|
|
primaryKey: false,
|
|
field: "dimension_key",
|
|
autoIncrement: false
|
|
},
|
|
dimensionLabel: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Dimension label",
|
|
primaryKey: false,
|
|
field: "dimension_label",
|
|
autoIncrement: false
|
|
},
|
|
timeStart: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Time start",
|
|
primaryKey: false,
|
|
field: "time_start",
|
|
autoIncrement: false
|
|
},
|
|
timeEnd: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Time end",
|
|
primaryKey: false,
|
|
field: "time_end",
|
|
autoIncrement: false
|
|
},
|
|
status: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: false,
|
|
defaultValue: "pending",
|
|
comment: "Item status",
|
|
primaryKey: false,
|
|
field: "status",
|
|
autoIncrement: false
|
|
},
|
|
reportInstanceId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Generated report instance id",
|
|
primaryKey: false,
|
|
field: "report_instance_id",
|
|
autoIncrement: false,
|
|
references: {
|
|
key: "id",
|
|
model: "reportInstance"
|
|
}
|
|
},
|
|
errorMessage: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Error message",
|
|
primaryKey: false,
|
|
field: "error_message",
|
|
autoIncrement: false
|
|
},
|
|
createdAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
|
comment: "Created time",
|
|
primaryKey: false,
|
|
field: "created_at",
|
|
autoIncrement: false
|
|
},
|
|
finishedAt: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "Finished time",
|
|
primaryKey: false,
|
|
field: "finished_at",
|
|
autoIncrement: false
|
|
}
|
|
}, {
|
|
tableName: "report_generation_batch_item",
|
|
comment: "Report generation batch item table",
|
|
indexes: []
|
|
});
|
|
dc.models.ReportGenerationBatchItem = ReportGenerationBatchItem;
|
|
return ReportGenerationBatchItem;
|
|
};
|
|
|