Tweak database schema
This commit is contained in:
parent
0fbb56d93b
commit
b6a76a5ee7
@ -4,11 +4,11 @@ exports.setup = function() {
|
|||||||
var db = new sqlite.Database('database.sql');
|
var db = new sqlite.Database('database.sql');
|
||||||
|
|
||||||
db.serialize(function() {
|
db.serialize(function() {
|
||||||
db.run('CREATE TABLE IF NOT EXISTS pings (id INT AUTO INCREMENT PRIMARY KEY, timestamp BIGINT NOT NULL, ip TINYTEXT, player MEDIUMINT)');
|
db.run('CREATE TABLE IF NOT EXISTS pings (timestamp BIGINT NOT NULL, ip TINYTEXT, playerCount MEDIUMINT)');
|
||||||
});
|
});
|
||||||
|
|
||||||
exports.log = function(ip, timestamp, playerCount) {
|
exports.log = function(ip, timestamp, playerCount) {
|
||||||
var insertStatement = db.prepare('INSERT INTO pings (timestamp, ip, player) VALUES (?, ?, ?)');
|
var insertStatement = db.prepare('INSERT INTO pings (timestamp, ip, playerCount) VALUES (?, ?, ?)');
|
||||||
|
|
||||||
insertStatement.run(timestamp, ip, playerCount);
|
insertStatement.run(timestamp, ip, playerCount);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user