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.
126 lines
2.7 KiB
126 lines
2.7 KiB
/* eslint-disable*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const sequelize = dc.orm;
|
|
const Backups = sequelize.define("backups", {
|
|
id: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: true,
|
|
field: "id",
|
|
autoIncrement: true,
|
|
unique: "backups_id_uindex"
|
|
},
|
|
note: {
|
|
type: DataTypes.STRING,
|
|
allowNull: false,
|
|
defaultValue: null,
|
|
comment: "备注信息",
|
|
primaryKey: false,
|
|
field: "note",
|
|
autoIncrement: false
|
|
},
|
|
databases: {
|
|
type: DataTypes.JSONB,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "databases",
|
|
autoIncrement: false
|
|
},
|
|
size: {
|
|
type: DataTypes.STRING,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "size",
|
|
autoIncrement: false
|
|
},
|
|
createTime: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "create_time",
|
|
autoIncrement: false
|
|
},
|
|
completeTime: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "备份完成时间",
|
|
primaryKey: false,
|
|
field: "complete_time",
|
|
autoIncrement: false
|
|
},
|
|
state: {
|
|
type: DataTypes.STRING,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "state",
|
|
autoIncrement: false
|
|
},
|
|
source: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "备份文件路径",
|
|
primaryKey: false,
|
|
field: "source",
|
|
autoIncrement: false
|
|
},
|
|
log: {
|
|
type: DataTypes.TEXT,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "备份日志",
|
|
primaryKey: false,
|
|
field: "log",
|
|
autoIncrement: false
|
|
},
|
|
restoreDatabases: {
|
|
type: DataTypes.JSONB,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: null,
|
|
primaryKey: false,
|
|
field: "restore_databases",
|
|
autoIncrement: false
|
|
},
|
|
restoreStart: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "恢复开始时间",
|
|
primaryKey: false,
|
|
field: "restore_start",
|
|
autoIncrement: false
|
|
},
|
|
restoreEnd: {
|
|
type: DataTypes.DATE,
|
|
allowNull: true,
|
|
defaultValue: null,
|
|
comment: "恢复结束时间",
|
|
primaryKey: false,
|
|
field: "restore_end",
|
|
autoIncrement: false
|
|
},
|
|
|
|
}, {
|
|
tableName: "backups",
|
|
comment: "",
|
|
indexes: []
|
|
});
|
|
dc.models.Backups = Backups;
|
|
return Backups;
|
|
};
|