2021-03-11 16:57:46 -05:00
|
|
|
defmodule Shift73k.Repo.Migrations.CreateShiftTemplates do
|
2021-03-06 13:48:13 -05:00
|
|
|
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
|
2021-03-06 13:48:13 -05:00
|
|
|
add :user_id, references(:users, on_delete: :nothing, type: :binary_id)
|
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
|
|
|
create index(:shift_templates, [:user_id])
|
|
|
|
end
|
|
|
|
end
|