shift73k/priv/repo/migrations/20210306171754_create_shift_templates.exs

21 lines
613 B
Elixir
Raw Normal View History

2021-03-11 16:57:20 -05:00
defmodule Shift73k.Repo.Migrations.CreateShifts.Templates do
use Ecto.Migration
def change do
create table(:shift_templates, primary_key: false) do
add :id, :binary_id, primary_key: true
2021-03-11 13:30:30 -05:00
add :subject, :string, size: 280, null: false
add :location, :string, size: 280
add :description, :text
add :time_zone, :string, null: false
add :time_start, :time, null: false
add :time_end, :time, null: false
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
timestamps()
end
create index(:shift_templates, [:user_id])
end
end