ash v0.10.0 Ash.Dsl.CreateTimestamp View Source
Link to this section Summary
Functions
Declares a non-writable attribute with a create default of &DateTime.utc_now/0
Link to this section Functions
Declares a non-writable attribute with a create default of &DateTime.utc_now/0
Examples
create_timestamp :inserted_at
Arguments
:name
- The name of the attribute.
Options
:type
- false The type of the attribute. The default value is:utc_datetime
.:constraints
- Constraints to provide to the type when casting the value. See the type's documentation for more information.:primary_key?
- Whether or not the attribute is part of the primary key (one or more fields that uniquely identify a resource) The default value isfalse
.:allow_nil?
- Whether or not the attribute can be set to nil The default value istrue
.:generated?
- Whether or not the value may be generated by the data layer The default value isfalse
.:writable?
- false Whether or not the value can be written to The default value isfalse
.:update_default
- A zero argument function, an {mod, fun, args} triple or{:constant, value}
. If no value is provided for the attribute on update, this value is used.:default
- false A zero argument function, an {mod, fun, args} triple or{:constant, value}
. If no value is provided for the attribute on create, this value is used. The default value is&DateTime.utc_now/0
.