mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 16:03:25 +00:00
4144e9ffd0
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
18 lines
569 B
Elixir
18 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
|