mobilizon/priv/repo/migrations/20200406115807_add_conversations.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

19 lines
569 B
Elixir

defmodule Mobilizon.Storage.Repo.Migrations.AddConversations do
use Ecto.Migration
def change do
create table(:conversations) do
add(:title, :string)
add(:slug, :string)
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
add(:creator_id, references(:actors, on_delete: :nilify_all))
add(:last_comment_id, references(:comments, on_delete: :delete_all))
timestamps()
end
alter table(:comments) do
add(:conversation_id, references(:conversations, on_delete: :delete_all))
end
end
end