2018-10-11 17:37:39 +02:00
|
|
|
defmodule Mobilizon.Repo.Migrations.CreateComments do
|
2018-05-17 11:32:23 +02:00
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create table(:comments) do
|
2019-02-22 14:18:52 +01:00
|
|
|
add(:url, :string)
|
|
|
|
add(:text, :text)
|
2018-05-17 11:32:23 +02:00
|
|
|
|
2019-02-22 14:18:52 +01:00
|
|
|
add(:account_id, references(:accounts, on_delete: :nothing), null: false)
|
|
|
|
add(:event_id, references(:events, on_delete: :nothing))
|
|
|
|
add(:in_reply_to_comment_id, references(:categories, on_delete: :nothing))
|
|
|
|
add(:origin_comment_id, references(:addresses, on_delete: :delete_all))
|
2018-05-17 11:32:23 +02:00
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|