Skip to content

Commit 2134a6e

Browse files
committed
docs(objectql): the generated migration reproduces the declared column DEFAULT
1 parent 0425f49 commit 2134a6e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

content/docs/protocol/objectql/types.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,15 @@ directly. `datetime` on PostgreSQL/MySQL keeps the native `now()`, which is
508508
already UTC — the driver pins every MySQL connection with
509509
`SET time_zone = '+00:00'`.
510510

511+
Both `os generate migration` formats reproduce the PostgreSQL arm of this
512+
translation, so a table built from a generated migration carries the same
513+
default as one the driver creates. That holds for a plain literal
514+
`defaultValue` too — and for the two shapes that deliberately get **no** column
515+
default on either producer, because the engine resolves them per insert:
516+
`defaultValue: 'current_user'` (which must stay unset when there is no
517+
authenticated user) and an Expression envelope (`{ dialect, source }`). An
518+
option-level `default: true` on a `select` is likewise engine-only.
519+
511520
<Callout type="warn">
512521
A DDL default only governs **newly created** columns. A column created before
513522
this convention keeps its legacy default and can still emit a zone-naive value on

0 commit comments

Comments
 (0)