timestamps method
void
timestamps({})
Adds created_at and updated_at timestamps.
Implementation
void timestamps({
bool useCurrent = true,
bool timezoneAware = false,
bool nullable = false,
int precision = 3,
}) {
final created = timestamp(
'created_at',
timezoneAware: timezoneAware,
precision: precision,
);
final updated = timestamp(
'updated_at',
timezoneAware: timezoneAware,
precision: precision,
);
if (useCurrent) {
created.useCurrentTimestamp();
updated.useCurrentTimestamp().useCurrentOnUpdate();
}
if (nullable) {
created.nullable();
updated.nullable();
}
}