start rc_db model

This commit is contained in:
Stefan Sterz 2016-02-01 16:07:55 +01:00
parent 06ade23691
commit 9428b83358
1 changed files with 17 additions and 0 deletions

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