I am attempting to model an existing MSSQL table in SailsJS. Unsurprisingly the tables in the existing database have a createdAt and updatedAt column similar to what is generated by the SailsJS framework.
Is there a way to assign the value of the property generated by the SailsJS framework to an attribute that I have defined? For example:
attributes: {
...
creationDate:{
columnName:'cre_dt',
type:'datetime',
defaultsTo: this.createdAt
}
...
}
created_ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
, would you have to use anafterUpdate
handler to load the resource back out of the DB and bind the data back to the resource? – Fouquiertinville