homeman-elixir/priv/repo/migrations/20240122054006_create_todos.exs

18 lines
506 B
Elixir
Raw Normal View History

2024-01-21 23:48:10 -06:00
defmodule Homeman.Repo.Migrations.CreateTodos do
use Ecto.Migration
def change do
create table(:todos, primary_key: false) do
add :id, :binary_id, primary_key: true
add :description, :string
add :emoji, :string, null: true
add :completed_at, :naive_datetime, null: true
add :assignee_user_id, references(:users, on_delete: :nothing, type: :binary_id), null: true
timestamps(type: :utc_datetime)
end
create index(:todos, [:assignee_user_id])
end
end