initial liveview/context/schema generation for Shifts
This commit is contained in:
parent
c864ff9563
commit
290475c101
15 changed files with 648 additions and 6 deletions
priv/repo/migrations
|
@ -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
|
||||
|
|
21
priv/repo/migrations/20210311220933_create_shifts.exs
Normal file
21
priv/repo/migrations/20210311220933_create_shifts.exs
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue