I am using postgresql. When i run some migrations with knexjs - sql builder to make tables in my DB, then the created_at time at the tables is one hour earlier then my time on my local machine.
If the time on my local machine is 13:30, in the tables i get 12:30 when i create timestamps.
exports.up = async function (knex) {
await knex.schema.createTable("users", function (t) {
t.uuid('id').primary();
t.timestamps(true, true);
});
};
My knexfile.js looks like this
const config = {
client: 'pg',
connection: {
host: process.env.POSTGRES_HOST || 'localhost',
database: process.env.POSTGRES_DB || 'db',
user: process.env.POSTGRES_USER || 'postgres',
password: process.env.POSTGRES_PASSWORD || 'pass',
},
pool: { min: 0, max: 10 },
migrations: { directory: './db/migrations' }
};
module.exports = config;
i tried adding
timezone: 'UTC',
in the connection property but without success.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…