18 lines
506 B
Elixir
18 lines
506 B
Elixir
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
|