BitcrowdEcto.Schema (bitcrowd_ecto v0.6.0) View Source

An opinionated set of defaults for Ecto schemas.

  • Uses Ecto.Schema and imports Ecto.Changeset and BitcrowdEcto.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 t as a struct of the schema module.
  • Defines an id type

Usage

defmodule MyApp.MySchema do
  use BitcrowdEcto.Schema
end

Or if you table lives in a different Postgres schema:

defmodule MyApp.MySchema do
  use BitcrowdEcto.Schema, prefix: "foo"
end