cleaned up parentheses in schemas
This commit is contained in:
parent
f28c85e343
commit
6a5d2346ff
5 changed files with 19 additions and 19 deletions
lib/shift73k
|
|
@ -20,19 +20,19 @@ defmodule Shift73k.Accounts.User do
|
|||
@primary_key {:id, :binary_id, autogenerate: true}
|
||||
@foreign_key_type :binary_id
|
||||
schema "users" do
|
||||
field(:email, :string)
|
||||
field(:password, :string, virtual: true)
|
||||
field(:hashed_password, :string)
|
||||
field(:confirmed_at, :naive_datetime)
|
||||
field(:calendar_slug, :string, default: Ecto.UUID.generate())
|
||||
field :email, :string
|
||||
field :password, :string, virtual: true
|
||||
field :hashed_password, :string
|
||||
field :confirmed_at, :naive_datetime
|
||||
field :calendar_slug, :string, default: Ecto.UUID.generate()
|
||||
|
||||
field(:role, Ecto.Enum, values: Keyword.keys(@roles), default: :user)
|
||||
field(:week_start_at, Ecto.Enum, values: weekdays(), default: :monday)
|
||||
field :role, Ecto.Enum, values: Keyword.keys(@roles), default: :user
|
||||
field :week_start_at, Ecto.Enum, values: weekdays(), default: :monday
|
||||
|
||||
has_many(:shift_templates, ShiftTemplate)
|
||||
belongs_to(:fave_shift_template, ShiftTemplate)
|
||||
has_many :shift_templates, ShiftTemplate
|
||||
belongs_to :fave_shift_template, ShiftTemplate
|
||||
|
||||
has_many(:shifts, Shift)
|
||||
has_many :shifts, Shift
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ defmodule Shift73k.Accounts.UserToken do
|
|||
@primary_key {:id, :binary_id, autogenerate: true}
|
||||
@foreign_key_type :binary_id
|
||||
schema "users_tokens" do
|
||||
field(:token, :binary)
|
||||
field(:context, :string)
|
||||
field(:sent_to, :string)
|
||||
belongs_to(:user, Shift73k.Accounts.User)
|
||||
field :token, :binary
|
||||
field :context, :string
|
||||
field :sent_to, :string
|
||||
belongs_to :user, Shift73k.Accounts.User
|
||||
|
||||
timestamps(updated_at: false)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ defmodule Shift73k.Shifts.Shift do
|
|||
field :time_start, :time
|
||||
field :time_end, :time
|
||||
|
||||
belongs_to(:user, Shift73k.Accounts.User)
|
||||
belongs_to :user, Shift73k.Accounts.User
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ defmodule Shift73k.Shifts.Templates.ShiftTemplate do
|
|||
field :time_start, :time, default: ~T[09:00:00]
|
||||
field :time_end, :time, default: ~T[17:00:00]
|
||||
|
||||
belongs_to(:user, Shift73k.Accounts.User)
|
||||
has_one(:is_fave_of_user, Shift73k.Accounts.User, foreign_key: :fave_shift_template_id)
|
||||
belongs_to :user, Shift73k.Accounts.User
|
||||
has_one :is_fave_of_user, Shift73k.Accounts.User, foreign_key: :fave_shift_template_id
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue