Change field name for CreatedAt / UpdateAt Attributes

前端 未结 3 1304
小蘑菇
小蘑菇 2020-12-30 05:59

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 gene

3条回答
  •  执笔经年
    2020-12-30 06:32

    You could remap the following way:

    attributes: {
        createdAt: {
          type: 'datetime',
          columnName: 'cre_dt'
        },
        updatedAt: {
          type: 'datetime',
          columnName: 'upd_dt'
        },
        // your other columns
      }
    

提交回复
热议问题