1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 16:03:25 +00:00
mobilizon/priv/repo/migrations/20191025083642_add_mention_tables.exs
Thomas Citharel cc820d6b63
Refactor Core things, including Ecto handling, ActivityPub & Transmogrifier modules
* Data doesn't need anymore to be converted to ActivityStream format to
be saved (this was taken from Pleroma and not at all a good idea here)
* Everything saved when creating an event is inserted into PostgreSQL in
a single transaction
2019-10-31 10:06:11 +01:00

16 lines
511 B
Elixir

defmodule Mobilizon.Storage.Repo.Migrations.AddMentionTables do
use Ecto.Migration
def change do
create table(:mentions) do
add(:silent, :boolean, default: false, null: false)
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
add(:event_id, references(:events, on_delete: :delete_all), null: true)
add(:comment_id, references(:comments, on_delete: :delete_all), null: true)
timestamps()
end
create(index(:mentions, [:actor_id]))
end
end