mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-26 19:21:43 +00:00
[SIS-xxx] making quote attachment URL column larger
changing migration script for starboard/quotes
This commit is contained in:
@@ -2,17 +2,18 @@ from sqlalchemy.sql import text
|
||||
|
||||
|
||||
def load_all_starboard_posts(conn):
|
||||
squery = text("""select sp.id, sp.author_user_in_server_id, sp.source_channel_id, sp.server_id, sp.post_message_id, spr.reactor_user_in_server_id, sp.created
|
||||
squery = text("""select distinct sp.id, sp.author_user_in_server_id, sp.source_channel_id, sp.server_id, sp.post_message_id, spr.reactor_user_in_server_id, sp.created
|
||||
from starboard_post sp
|
||||
inner join starboard_post_reaction spr
|
||||
on sp.id = spr.post_id
|
||||
and spr.created = (
|
||||
select spr.created
|
||||
from starboard_post_reaction spr2
|
||||
where spr2.post_id = sp.id
|
||||
order by created limit 1
|
||||
)
|
||||
where sp.ignored = false
|
||||
inner join starboard_post_reaction spr
|
||||
on sp.id = spr.post_id
|
||||
and spr.reactor_user_in_server_id = (
|
||||
select reactor_user_in_server_id
|
||||
from starboard_post_reaction spr2
|
||||
where spr2.post_id = sp.id
|
||||
order by created limit 1
|
||||
)
|
||||
where sp.ignored = false
|
||||
and sp.post_message_id not in (select message_id from quote)
|
||||
""")
|
||||
rs = conn.execute(squery)
|
||||
found_posts = []
|
||||
|
||||
Reference in New Issue
Block a user