initial liveview/context/schema generation for Shifts

This commit is contained in:
Adam Piontek 2021-03-11 17:16:11 -05:00
parent c864ff9563
commit 290475c101
15 changed files with 648 additions and 6 deletions

View file

@ -15,6 +15,6 @@ defmodule Shift73k.Repo.Migrations.CreateShiftTemplates do
timestamps()
end
create index(:shift_templates, [:user_id])
create index(:shift_templates, [:user_id, :subject])
end
end

View file

@ -0,0 +1,21 @@
defmodule Shift73k.Repo.Migrations.CreateShifts do
use Ecto.Migration
def change do
create table(:shifts, primary_key: false) do
add :id, :binary_id, primary_key: true
add :subject, :string, size: 280, null: false
add :location, :string, size: 280
add :description, :text
add :date, :date, null: false
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(:shifts, [:user_id, :subject])
end
end