winston-cassandra
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -102,13 +102,14 @@ var util = require('util'); | ||
Cassandra.prototype._createSchema = function (callback) { | ||
var query = 'SELECT columnfamily_name FROM system.schema_columnfamilies WHERE keyspace_name=? AND columnfamily_name=?'; | ||
var params = [this.options.keyspace, this.options.table]; | ||
var createQuery = 'CREATE TABLE ' + this.options.table + | ||
' (key text, date timestamp, level text, message text, meta text, PRIMARY KEY(key, date));'; | ||
var self = this; | ||
this.client.execute(query, params, function (err, result) { | ||
this.client.metadata.getTable(this.options.keyspace, this.options.table, function (err, tableInfo) { | ||
if (err) return callback(err); | ||
if (result.rows.length === 1) { | ||
if (tableInfo) { | ||
//table is already created | ||
self.schemaStatus.created = true; | ||
return callback(); | ||
} | ||
return self.client.execute(createQuery, function (err) { | ||
@@ -115,0 +116,0 @@ self.schemaStatus.created = !err; |
{ | ||
"name": "winston-cassandra", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Cassandra transport for winston", | ||
@@ -21,3 +21,3 @@ "author": "Jorge Bay <jorgebaygondra@gmail.com>", | ||
"async": "^1.4.2", | ||
"cassandra-driver": "^2.2.2", | ||
"cassandra-driver": "^3.0.1", | ||
"winston": "^1.1.1" | ||
@@ -24,0 +24,0 @@ }, |
Sorry, the diff of this file is not supported yet
8092
130
+ Addedcassandra-driver@3.6.0(transitive)
- Removedasync@0.9.2(transitive)
- Removedcassandra-driver@2.2.2(transitive)
Updatedcassandra-driver@^3.0.1