The fix is fairly simple if you have a backup saved. Open xterm and type rm -rf .rtcom-eventlogger to clear the corrupt database and then do a restore as normal. After the restore reboots your device, everything will be back to normal, and the messages that arrived but were not saved while the database was broken should appear again. Anything you sent will have vanished though.