Document inbox_messageStates clean-up, and write an upgrade script to delete
states from users who have already been deleted.
This commit is contained in:
parent
8ece5d63c6
commit
defbec3171
2 changed files with 11 additions and 0 deletions
|
|
@ -34,6 +34,7 @@ my $session = start(); # this line required
|
|||
addSmsGatewaySubjectSetting($session);
|
||||
addInboxNotificationsSubjectSetting($session);
|
||||
profileFieldRequiredEditable($session);
|
||||
deleteOldInboxMessageStates($session);
|
||||
finish($session); # this line required
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
@ -45,6 +46,15 @@ finish($session); # this line required
|
|||
# print "DONE!\n" unless $quiet;
|
||||
#}
|
||||
|
||||
sub deleteOldInboxMessageStates {
|
||||
my $session = shift;
|
||||
print "\tDelete Inbox messages states for users who have been deleted... " unless $quiet;
|
||||
$session->db->write(<<EOSQL);
|
||||
DELETE FROM inbox_messageState WHERE userId NOT IN (SELECT userId FROM users)
|
||||
EOSQL
|
||||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
sub profileFieldRequiredEditable {
|
||||
my $session = shift;
|
||||
print "\tTurn on the editable bit for all Profile Fields which are required... " unless $quiet;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue