View Source BitcrowdEcto.Schema (bitcrowd_ecto v1.0.0)
An opinionated set of defaults for Ecto schemas.
- Uses
Ecto.Schemaand importsEcto.ChangesetandBitcrowdEcto.Changeset - Configures an autogenerated PK of type
binary_id - Configures FKs to be of type
binary_id - Sets timestamp type to
utc_datetime_usec - Defines a type
tas a struct of the schema module. - Defines an
idtype
Usage
defmodule MyApp.MySchema do
use BitcrowdEcto.Schema
endOr if you table lives in a different Postgres schema:
defmodule MyApp.MySchema do
use BitcrowdEcto.Schema, prefix: "foo"
end
Summary
Functions
Safely converts a string into an enum member atom. Returns nil if conversion is not posssible.
Safely converts a string into an enum member atom. Raises if conversion is not possible.