How do I make the default timestamp columns behave?

I'm trying to force these columns to do two things:

  1. Use "timestamp without time zone" (the backend is Postgres).
  2. Actually set the default on the backend to "now/utc".

        {
            // a bunch of column definitions
            createdAt: { type: DataTypes.DATE, defaultValue: sequelize.fn('now') }
        }, 
        {
            timestamps: false,
            comment: "this isn't even the real comment"
        }
    

The results are this:

CREATE TABLE IF NOT EXISTS "common"."images" ("id" VARCHAR(255) , "imageType"
VARCHAR(255), "mimeType" TEXT, "source" VARCHAR(255), "path" TEXT UNIQUE, 
"createdAt" TIMESTAMP WITH TIME ZONE DEFAULT now(), PRIMARY KEY ("id")); 
COMMENT ON TABLE "common"."images" IS 'blah blah blah.';

However, I can't find any documentation on how I could force this to be a timestamp-without-tz, or how I can make the default "now() at time zone 'utc'".

Are either of these possible?

If they are possible, can it be done without setting timestamps to false and manually defining the column as I have done?

When you set up your sequelize instance, you can set options.timezone to UTC which sets the timezone for all sequelize connections, meaning every NOW() call would be in UTC. This would work with the default timestamps too. See the docs: http://sequelize.readthedocs.org/en/latest/api/sequelize/

Alternatively, you could modify your postgresql.conf and default the timezone there.

Apparently there is a fairly elegant solution for the second half of this question. Sequelize presents a "literal" method that allows you to (among other things) make a default value exactly as you like.

{
    // a bunch of column definitions
    createdAt: { type: DataTypes.DATE, defaultValue: sequelize.literal("(now() at time zone 'utc')") }
}, 

I wrap it in double quotes because Postgres wants single quotes around the "utc" on the back end.

Of course, Yuri is correct in that there are no "without time zone" data types in Sequelize, nor any option to configure the Data type that way. I know that partial answers are discouraged here, but thought this might help others.