@write-coin/automation-db
Advanced tools
Comparing version 1.1.0 to 2.1.0
@@ -21,7 +21,7 @@ const sequelize = require('./db') | ||
const AccountPropertyType = sequelize.define('account_property_type', { | ||
name: {type: DataTypes.STRING, unique: true } | ||
name: {type: DataTypes.STRING, unique: true, allowNull: false } | ||
}) | ||
const DataType = sequelize.define('data_type', { | ||
name: {type: DataTypes.STRING, unique: true } | ||
name: {type: DataTypes.STRING, unique: true, allowNull: false } | ||
}) | ||
@@ -36,5 +36,25 @@ | ||
const ProjectPropertyType = sequelize.define('project_property_type', { | ||
name: {type: DataTypes.STRING, unique: true } | ||
name: {type: DataTypes.STRING, unique: true, allowNull: false } | ||
}) | ||
const Log = sequelize.define('log', { | ||
actionTime: {type: DataTypes.DATE, allowNull: false } | ||
}) | ||
const ActionType = sequelize.define('action_type', { | ||
name: {type: DataTypes.STRING, unique: true, allowNull: false } | ||
}) | ||
const LogProperty = sequelize.define('log_property', { | ||
value: {type: DataTypes.STRING } | ||
}) | ||
const LogPropertyType = sequelize.define('log_property_type', { | ||
name: {type: DataTypes.STRING, unique: true, allowNull: false } | ||
}) | ||
const ActionStatus = sequelize.define('aciton_status', { | ||
name: {type: DataTypes.STRING, unique: true, allowNull: false } | ||
}) | ||
// Project.hasMany(ProjectAccount) | ||
@@ -67,2 +87,23 @@ // ProjectAccount.belongsTo(Project) | ||
Log.hasOne(Account) | ||
Log.belongsTo(Account) | ||
Log.hasOne(Project) | ||
Log.belongsTo(Project) | ||
Log.hasOne(ActionType) | ||
Log.belongsTo(ActionType) | ||
Log.hasOne(ActionStatus) | ||
Log.belongsTo(ActionStatus) | ||
Log.hasMany(LogProperty) | ||
LogProperty.belongsTo(Log) | ||
LogProperty.hasOne(LogPropertyType) | ||
LogProperty.belongsTo(LogPropertyType) | ||
LogPropertyType.hasOne(DataType) | ||
LogPropertyType.belongsTo(DataType) | ||
module.exports = { | ||
@@ -77,3 +118,8 @@ Project, | ||
ProjectProperty, | ||
ProjectPropertyType | ||
ProjectPropertyType, | ||
Log, | ||
ActionType, | ||
ActionStatus, | ||
LogProperty, | ||
LogPropertyType | ||
} |
{ | ||
"name": "@write-coin/automation-db", | ||
"version": "1.1.0", | ||
"version": "2.1.0", | ||
"description": "ORM для базы данных automation_statistic", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7663
126