Better cleanup of Inbox messages. Encapsulate all SQL in Inbox/Message. Fix workflow. Upgrade script to cleanup state table. Fixes bug #11595.
This commit is contained in:
parent
28eabdd997
commit
30e869b66d
6 changed files with 72 additions and 30 deletions
|
|
@ -7,6 +7,7 @@
|
|||
- fixed #11611: Thingy: The add field pop up box has multiple "Text" field types
|
||||
- fixed #11610: Bad hover help for CS sortBy field
|
||||
- fixed #11605: UserList refers to non-existent "publicEmail" user profiling field
|
||||
- fixed #11595: Orphaned data in inbox_messageState
|
||||
|
||||
7.9.6
|
||||
- new checkbox in the asset manager for clearing the package flag on import
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ my $session = start(); # this line required
|
|||
# upgrade functions go here
|
||||
restoreDefaultCronJobs($session);
|
||||
restoreCsCronJobs($session);
|
||||
cleanup_inbox_messageStateTable($session);
|
||||
|
||||
finish($session); # this line required
|
||||
|
||||
|
|
@ -50,6 +51,22 @@ finish($session); # this line required
|
|||
# print "DONE!\n" unless $quiet;
|
||||
#}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
sub cleanup_inbox_messageStateTable {
|
||||
my $session = shift;
|
||||
print "\tDelete dead entries from the inbox_MessageState table. This may take a long time... " unless $quiet;
|
||||
# and here's our code
|
||||
my $source = $session->db->read("select messageId from inbox_messageState s where not exists(select messageId from inbox where messageId = s.messageId)");
|
||||
my $cleaner = $session->db->prepare("delete from inbox_messageState where messageId=?");
|
||||
while (my ($messageId) = $source->array) {
|
||||
$cleaner->execute([$messageId]);
|
||||
}
|
||||
$source->finish;
|
||||
$cleaner->finish;
|
||||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Describe what our function does
|
||||
sub restoreDefaultCronJobs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue