Skip to content

Instantly share code, notes, and snippets.

@robwormald
Created January 27, 2014 04:43
Show Gist options
  • Save robwormald/8643392 to your computer and use it in GitHub Desktop.
Save robwormald/8643392 to your computer and use it in GitHub Desktop.
var uuid = require('node-uuid')
module.exports = {
connection : 'mcguffy_mccloud2',
//tableName : 'time_log_dev',
migrate : 'alter',
attributes: {
id : {
type : 'string',
primaryKey : true,
required : true,
},
end : {
type : 'datetime',
// columnName : 'time_end'
},
start : {
type : 'datetime',
// columnName : 'time_start',
//required : true
// defaultsTo : 'NOW'
},
//-> has one (stored in db)
employee : {
model : 'employee',
type : 'string',
//required : true
},
//-> has one (stored in db)
project : {
model : 'project',
type : 'string'
},
operationcode : {
model : 'operationcode',
type : 'string',
//required : true
},
notes : {
type : 'string'
},
approval_status : {
type : 'integer',
//defaultsTo : 1
}
},
beforeCreate : function(values,cb){
console.log('create?')
if(!values.id){
values.id = uuid.v4();
}
cb()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment