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.

69 lines
1.3 KiB

4 years ago
import _sequelize from 'sequelize';
const { Model, Sequelize } = _sequelize;
export default class checklistresults extends Model {
static init(sequelize, DataTypes) {
super.init({
ID: {
autoIncrement: true,
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
UnitId: {
type: DataTypes.INTEGER,
allowNull: true
},
ChecklistId: {
type: DataTypes.INTEGER,
allowNull: true
},
QuestionId: {
type: DataTypes.INTEGER,
allowNull: true
},
InspectionId: {
type: DataTypes.INTEGER,
allowNull: true
},
Answer: {
type: DataTypes.STRING(50),
allowNull: true
},
Comment: {
type: DataTypes.STRING(200),
allowNull: true
},
Status: {
type: DataTypes.TINYINT.UNSIGNED,
allowNull: true
},
CreateDate: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: Sequelize.fn('current_timestamp')
},
DeleteDate: {
type: DataTypes.DATE,
allowNull: true
}
}, {
sequelize,
tableName: 'checklistresults',
hasTrigger: true,
timestamps: false,
indexes: [
{
name: "PRIMARY",
unique: true,
using: "BTREE",
fields: [
{ name: "ID" },
]
},
]
});
return checklistresults;
}
}