Skip to content

Commit 3729cae

Browse files
committed
Use timezone with postgres
1 parent 9286e40 commit 3729cae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/adapters/postgres.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function () {
2929
return this.db.execute(
3030
`ALTER TABLE ${table} ADD ${this.wrap(
3131
updatedAtColumnName
32-
)} TIMESTAMP(3) WITHOUT TIME ZONE`,
32+
)} TIMESTAMP(3) WITH TIME ZONE`,
3333
null,
3434
options
3535
)
@@ -44,7 +44,7 @@ module.exports = function () {
4444
)} (<fields>${
4545
updatedAtColumnName ? `,"${updatedAtColumnName}"` : ''
4646
}) VALUES (<values>${
47-
updatedAtColumnName ? `,(now() at time zone 'utc')` : ''
47+
updatedAtColumnName ? `,now()` : ''
4848
}) RETURNING *`
4949
}
5050

@@ -54,7 +54,7 @@ module.exports = function () {
5454
data.identity.name
5555
)} SET <fields-values>${
5656
updatedAtColumnName
57-
? `,"${updatedAtColumnName}"=(now() at time zone 'utc')`
57+
? `,"${updatedAtColumnName}"=now()`
5858
: ''
5959
} WHERE <primary-keys> RETURNING *`
6060
}

0 commit comments

Comments
 (0)