Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

31 行
770B

  1. defmodule Pleroma.Repo.Migrations.MigrateSeenToUnreadInChatMessageReferences do
  2. use Ecto.Migration
  3. def change do
  4. drop(
  5. index(:chat_message_references, [:chat_id],
  6. where: "seen = false",
  7. name: "unseen_messages_count_index"
  8. )
  9. )
  10. alter table(:chat_message_references) do
  11. add(:unread, :boolean, default: true)
  12. end
  13. execute("update chat_message_references set unread = not seen")
  14. alter table(:chat_message_references) do
  15. modify(:unread, :boolean, default: true, null: false)
  16. remove(:seen, :boolean, default: false, null: false)
  17. end
  18. create(
  19. index(:chat_message_references, [:chat_id],
  20. where: "unread = true",
  21. name: "unread_messages_count_index"
  22. )
  23. )
  24. end
  25. end