fix: Don't crash if foreign key constraint is invalid in transaction (#1004)
ForeignKey constraints can be invalidated in the middle of a transaction even if a later statement in the same transaction will make them valid again. This seems to be causing production crashes. Defer foreign key constraint checks until the end of the transaction to prevent this.
This commit is contained in:
parent
fd9cc2ea96
commit
eeca401942
|
@ -55,6 +55,7 @@ import java.util.Date
|
||||||
entity = TimelineAccountEntity::class,
|
entity = TimelineAccountEntity::class,
|
||||||
parentColumns = ["serverId", "timelineUserId"],
|
parentColumns = ["serverId", "timelineUserId"],
|
||||||
childColumns = ["authorServerId", "timelineUserId"],
|
childColumns = ["authorServerId", "timelineUserId"],
|
||||||
|
deferred = true,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue