summaryrefslogtreecommitdiffstats
path: root/server/models
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-07 20:20:25 +0100
committerJannik Schönartz2019-03-07 20:20:25 +0100
commit0999302d99156200ff174d5ec56d6831c8afd332 (patch)
tree56dfcf175c3d5b15dd44eb8d156e4448caaa5455 /server/models
parent[server/ipranges] Forgot to commit the lib. ¯\_(ツ)_/¯ (diff)
downloadbas-0999302d99156200ff174d5ec56d6831c8afd332.tar.gz
bas-0999302d99156200ff174d5ec56d6831c8afd332.tar.xz
bas-0999302d99156200ff174d5ec56d6831c8afd332.zip
[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
Diffstat (limited to 'server/models')
-rw-r--r--server/models/conflict.js23
1 files changed, 23 insertions, 0 deletions
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
+}