From 9428b8335800e0b3f21288a1b698561b13ddf57c Mon Sep 17 00:00:00 2001 From: Stefan Sterz Date: Mon, 1 Feb 2016 16:07:55 +0100 Subject: [PATCH] start rc_db model --- nodejs/models/rc_db.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nodejs/models/rc_db.js diff --git a/nodejs/models/rc_db.js b/nodejs/models/rc_db.js new file mode 100644 index 0000000..32f5929 --- /dev/null +++ b/nodejs/models/rc_db.js @@ -0,0 +1,17 @@ +var mysql = require('mysql'); +var config = require('../config'); + +var connection = mysql.createConnection({ + host : config.mysql_host, + user : config.mysql_user, + password : config.mysql_secret, + database : config.mysql_database +}); + +connection.connect(); + +var RC = function () { + connection.query('CREATE TABLE IF NOT EXISTS rc_switches', function(err, rows, fields) { + if (err) throw err; + }); +}; \ No newline at end of file