Skip to content

Commit

Permalink
Add note regarding timestamps() for Postgres users (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshotN committed Jul 18, 2023
1 parent f8b760c commit aa2b286
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/guide/schema-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,10 @@ table.timestamp('created_at', { useTz: true });

Adds created\_at and updated\_at columns on the database, setting each to datetime types. When true is passed as the first argument a timestamp type is used instead. Both columns default to being not null and using the current timestamp when true is passed as the second argument. Note that on MySQL the .timestamps() only have seconds precision, to get better precision use the .datetime or .timestamp methods directly with precision. If useCamelCase is true, the name of columns are createdAt and updatedAt.

::: info
PostgreSQL `updated_at` field will not automatically be updated. Please see this [issue](https://github.com/knex/knex/issues/1928 "issue") for details
:::

### dropTimestamps

**table.dropTimestamps([useCamelCase])**
Expand Down

0 comments on commit aa2b286

Please sign in to comment.