node.jsormsails.jssails-postgresql

how to create a column with datatype 'TimeStampWithTimezone' in sails.js v1.0.2 models?


I'm using sails v 1.0.2 and sails-PostgreSQL adapter. I have a model that has a column of date type that saves current time in the format of timestamp with time zone. how should I do it? previously I created my database in pgAdmin statically but now I don't know how to do it in sails


Solution

  • A bit late, but in case anyone else comes across this question, here's how you do it:

    dateField: {
        type: 'ref',
        columnType: 'timestamptz'
    }