Implement first pass of announcement admin api
CCBUG: https://git.pleroma.social/pleroma/pleroma/-/issues/2836 CCBUG: https://git.pleroma.social/pleroma/pleroma/-/issues/1470
This commit is contained in:
parent
4458db3201
commit
d7af67012f
9 changed files with 392 additions and 0 deletions
23
priv/repo/migrations/20220308012601_create_announcements.exs
Normal file
23
priv/repo/migrations/20220308012601_create_announcements.exs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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)
|
||||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue