From 10c956eaebef2f98ae02428631a50d3aa8d02c3b Mon Sep 17 00:00:00 2001 From: Dawid Kubicki Date: Sat, 12 Jan 2019 13:17:52 +0100 Subject: [PATCH] db admin changes first --- dbScheme.js | 10 ---------- deviceSchema.js | 10 ++++++++++ index.js | 2 +- statusSchema.js | 8 ++++++++ 4 files changed, 19 insertions(+), 11 deletions(-) delete mode 100644 dbScheme.js create mode 100644 deviceSchema.js create mode 100644 statusSchema.js diff --git a/dbScheme.js b/dbScheme.js deleted file mode 100644 index dbcc024..0000000 --- a/dbScheme.js +++ /dev/null @@ -1,10 +0,0 @@ -const mongoose = require("mongoose"); -const dbSchema = new mongoose.Schema( - { - ip: String, - name: String, - status: String - }, - { timestamps: true } -); -module.exports = mongoose.model("dbSchema", dbSchema); diff --git a/deviceSchema.js b/deviceSchema.js new file mode 100644 index 0000000..971888f --- /dev/null +++ b/deviceSchema.js @@ -0,0 +1,10 @@ +const mongoose = require("mongoose"); +const deviceSchema = new mongoose.Schema( + { + ip: String, + name: String, + updateStatuses: [String] + }, + { timestamps: true } +); +module.exports = mongoose.model("deviceSchema", deviceSchema); diff --git a/index.js b/index.js index 5443f95..83c5e10 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const express = require("express"); const cors = require("cors"); const mongoose = require("mongoose"); const mongoDB = "mongodb://127.0.0.1/chillroom-database"; -const dbSchema = require("./dbScheme"); +const dbSchema = require("./statusSchema"); mongoose.connect( mongoDB, { useNewUrlParser: true } diff --git a/statusSchema.js b/statusSchema.js new file mode 100644 index 0000000..f7146d6 --- /dev/null +++ b/statusSchema.js @@ -0,0 +1,8 @@ +const mongoose = require("mongoose"); +const statusSchema = new mongoose.Schema( + { + status: [String] + }, + { timestamps: true } +); +module.exports = mongoose.model("statusSchema", statusSchema);