1 defmodule Pleroma.Repo.Migrations.CreateAnnouncements do
5 create_if_not_exists table(:announcements, primary_key: false) do
6 add(:id, :uuid, primary_key: true)
8 add(:starts_at, :naive_datetime)
9 add(:ends_at, :naive_datetime)
15 create_if_not_exists table(:announcement_read_relationships) do
16 add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
17 add(:announcement_id, references(:announcements, type: :uuid, on_delete: :delete_all))
19 timestamps(updated_at: false)
23 unique_index(:announcement_read_relationships, [:user_id, :announcement_id])