From 0999302d99156200ff174d5ec56d6831c8afd332 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Thu, 7 Mar 2019 19:20:25 +0000 Subject: [server] New clients are automaticly added to the groups of the fitting subranges Add conflict models Sequelize string operators depricated fix IPv4 is now saved as decimal in the database Add host to config instead of hardcoding Rename ip.js lib to iphelper.js --- server/models/conflict.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 server/models/conflict.js (limited to 'server/models') diff --git a/server/models/conflict.js b/server/models/conflict.js new file mode 100644 index 0000000..5769710 --- /dev/null +++ b/server/models/conflict.js @@ -0,0 +1,23 @@ +'use strict' +module.exports = (sequelize, DataTypes) => { + var conflict = sequelize.define('conflict', { + id: { + allowNull: false, + autoIncrement: true, + primaryKey: true, + type: DataTypes.INTEGER + }, + description: DataTypes.STRING(2048) + }, { + timestamps: false + }) + conflict.associate = function (models) { + var ConflictXObject = sequelize.define('conflict_x_object', { + objectType: DataTypes.STRING, + objectId: DataTypes.INTEGER + }, { timestamps: false, freezeTableName: true }) + conflict.hasMany(ConflictXObject, { as: 'objects' }) + } + + return conflict +} -- cgit v1.2.3-55-g7522