var nohm = require('nohm').Nohm;
var redis = require('redis').createClient();

//redis.on("connect", function() {
	nohm.setClient(redis);
	console.log("Nohm Connected to Redis Client");
//});

nohm.model('WSS', 
{
	properties: 
	{
		user_id: 
		{
			type: 'integer',
			defaultValue: 0
		},

		id: 
		{
			type: 'integer',
			defaultValue: 0
		},

		session_id: 
		{
			type: 'string',
			unique: true,
        	index: true
		},

		lot_id:
		{
			type: 'integer',
			defaultValue: 0
		},

		/*datetime_up:
		{
			type: 'timestamp',
			defaultValue: new Date()
		},*/
		datetime_up:
		{
			//type: 'string',
			//defaultValue: new Date()
		},

		member_user_id:
		{
			type: 'integer',
			defaultValue: 0
		},

		auk_id:
		{
			type: 'integer',
			defaultValue: 0
		}
	}
}/*,

methods:
{
	getOneWSS: function ( session_id )
	{

	},

	getAllWSS: function ( session_id )
	{

	},

	setNewWSS: function ( data )
	{

	},

	delOneWSS: function ( session_id )
	{

	}*/
);

var wss = nohm.factory('WSS');

//console.log('===', wss);
exports.WSS = wss;