Skip to content

Instantly share code, notes, and snippets.

@aleandros
Created March 22, 2017 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aleandros/c395ed82d0976cc907081e48ad6bdbb9 to your computer and use it in GitHub Desktop.
Save aleandros/c395ed82d0976cc907081e48ad6bdbb9 to your computer and use it in GitHub Desktop.
Ecto schema non-default conventions
defmodule MyApp.Bank do
use MyApp.Web, :model
@primary_key {:BankId, :id, autogenerate: true} # 1
schema "bank" do # 2
field :BankName, :string # 3
timestamps(inserted_at: :BankCreateDate, # 4
updated_at: :BankUpdateDate)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment