Closed KitsuneRal closed 6 months ago
portal.receiver
is changed to be uuid in the previous migration 🤔 https://github.com/mautrix/signal/blob/main/database/upgrades/16-refactor-postgres.sql#L58
Finally got back to this - turns out, that previous one (the specific statement you linked to) fails with
ERROR: null value in column "receiver" of relation "portal" violates not-null constraint
I might miss something obvious but receiver
is already checked before updating the table... I naïvely tried to replace receiver<>''
with receiver IS NOT NULL
and that helped literally nothing. Any idea what could give?
Oh I think I know what's going on - the receiver
check happens on the original receiver
value, not the one coming from the inner SELECT
, which may bring nothing - and that's exactly what's happening here (user
doesn't have the respective receiver).
I actually see quite a few receivers in portal
that have no matching row in user
- what should be done with those?
They're deleted 10 lines earlier in the migration: https://github.com/mautrix/signal/blob/main/database/upgrades/16-refactor-postgres.sql#L47-L48
Ah! I really should look through the whole script, and probably try to execute it one by one...
I could not figure out at which point this migration script choked and why but that very deletion somehow did not occur before. Once I executed it and the rest of the script manually, the bridge went up in the air. Thanks for helping!
Here's the relevant piece in the logs:
Using the bridge snapshot from de8c8d97c23dc1982686a698162b45f1f112155b. Looking at the actual tables,
portal.receiver
istext
butuser_portal.portal_receiver
isuuid
.