start rc_db model

This commit is contained in:
Shannon Sterz 2016-02-01 16:07:55 +01:00
parent 06ade23691
commit 9428b83358

17
nodejs/models/rc_db.js Normal file
View file

@ -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;
});
};