8000 Clarify date/time auto-timestamps (#39) · adonisjs/lucid.adonisjs.com@d7d5351 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7d5351

Browse files
authored
Clarify date/time auto-timestamps (#39)
Enhance date/time documentation with details on auto-timestamps
1 parent 8539f0b commit d7d5351

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/models/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ export default class User extends BaseModel {
219219
}
220220
```
221221

222-
Optionally, you can pass the `autoCreate` and `autoUpdate` options to always define the timestamps during the creation and the update operations. **Do note, setting these options doesn't modify the database table or its triggers.**
222+
Optionally, you can pass the `autoCreate` and `autoUpdate` options to automatically manage timestamps. `createdAt` is set when the record is first created, and `updatedAt` is set on both creation and every subsequent update. **Do note, these options do not modify the database schema itself. (e.g., adding triggers)**
223223

224-
If you don't want Luxon and prefer regular `Date` objects, you still can use a regular `@column` in combination with `consume` and `prepare`
224+
If you don't want Luxon and prefer regular `Date` objects, you can use a regular `@column` in combination with `consume` and `prepare`
225225

226226
```ts
227227
import { BaseModel, column } from '@adonisjs/lucid/orm'

0 commit comments

Comments
 (0)
0