start rc_db model
This commit is contained in:
parent
06ade23691
commit
9428b83358
1 changed files with 17 additions and 0 deletions
17
nodejs/models/rc_db.js
Normal file
17
nodejs/models/rc_db.js
Normal 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;
|
||||||
|
});
|
||||||
|
};
|
Reference in a new issue