Merge branch 'from/upstream-develop/tusooa/server-announcements' into 'develop'

Server announcements (1st pass)

See merge request pleroma/pleroma!3643
This commit is contained in:
Haelwenn 2022-07-03 20:58:20 +00:00
commit 6b937d1473
17 changed files with 1404 additions and 0 deletions

View file

@ -0,0 +1,26 @@
defmodule Pleroma.Repo.Migrations.CreateAnnouncements do
use Ecto.Migration
def change do
create_if_not_exists table(:announcements, primary_key: false) do
add(:id, :uuid, primary_key: true)
add(:data, :map)
add(:starts_at, :naive_datetime)
add(:ends_at, :naive_datetime)
add(:rendered, :map)
timestamps()
end
create_if_not_exists table(:announcement_read_relationships) do
add(:user_id, references(:users, type: :uuid, on_delete: :delete_all))
add(:announcement_id, references(:announcements, type: :uuid, on_delete: :delete_all))
timestamps(updated_at: false)
end
create_if_not_exists(
unique_index(:announcement_read_relationships, [:user_id, :announcement_id])
)
end
end