Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33103371
20200604150318_migrate_seen_to_unread_in_chat_message_references.exs
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
929 B
Referenced Files
None
Subscribers
None
20200604150318_migrate_seen_to_unread_in_chat_message_references.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.Repo.Migrations.MigrateSeenToUnreadInChatMessageReferences
do
use
Ecto.Migration
def
change
do
drop
(
index
(
:chat_message_references
,
[
:chat_id
],
where
:
"seen = false"
,
name
:
"unseen_messages_count_index"
)
)
alter
table
(
:chat_message_references
)
do
add
(
:unread
,
:boolean
,
default
:
true
)
end
execute
(
"update chat_message_references set unread = not seen"
)
alter
table
(
:chat_message_references
)
do
modify
(
:unread
,
:boolean
,
default
:
true
,
null
:
false
)
remove
(
:seen
,
:boolean
,
default
:
false
,
null
:
false
)
end
create
(
index
(
:chat_message_references
,
[
:chat_id
],
where
:
"unread = true"
,
name
:
"unread_messages_count_index"
)
)
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Tue, Jan 20, 1:43 PM (1 d, 2 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
973428
Default Alt Text
20200604150318_migrate_seen_to_unread_in_chat_message_references.exs (929 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment