1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-26 17:59:26 +00:00
mobilizon/priv/repo/migrations/20200221095721_create_todos.exs
Thomas Citharel 4144e9ffd0
Introduce group basic federation, event new page and notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-06-03 16:01:26 +02:00

28 lines
870 B
Elixir

defmodule Mobilizon.Repo.Migrations.CreateTodos do
use Ecto.Migration
def change do
create table(:todo_lists, primary_key: false) do
add(:id, :uuid, primary_key: true)
add(:title, :string)
add(:url, :string)
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
timestamps()
end
create table(:todos, primary_key: false) do
add(:id, :uuid, primary_key: true)
add(:title, :string)
add(:url, :string)
add(:status, :boolean, default: false, null: false)
add(:due_date, :utc_datetime)
add(:creator_id, references(:actors, on_delete: :delete_all), null: false)
add(:assigned_to_id, references(:actors, on_delete: :nilify_all))
add(:todo_list_id, references(:todo_lists, on_delete: :delete_all, type: :uuid), null: false)
timestamps()
end
end
end