User Tools

Site Tools


schema_0_9_10_upgrade_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
schema_0_9_10_upgrade_notes [2008/11/03 23:17] danielschema_0_9_10_upgrade_notes [2008/11/04 12:27] (current) daniel
Line 148: Line 148:
  (SELECT ac.attachment_id FROM attachment_contents ac LEFT JOIN attachments a ON ac.attachment_id=a.attachment_id  (SELECT ac.attachment_id FROM attachment_contents ac LEFT JOIN attachments a ON ac.attachment_id=a.attachment_id
    WHERE a.attachment_id IS NULL);    WHERE a.attachment_id IS NULL);
 +</code>
  
 Check entries in ''attachments'' that refer to deleted mail Check entries in ''attachments'' that refer to deleted mail
Line 166: Line 167:
 === All deletes and updates combined === === All deletes and updates combined ===
 <code sql> <code sql>
 +CREATE OR REPLACE VIEW all_mail AS SELECT * FROM mail UNION SELECT * FROM trashed_mail;
 +
 DELETE FROM mail_addresses WHERE mail_id IN DELETE FROM mail_addresses WHERE mail_id IN
 (SELECT ma.mail_id FROM mail_addresses ma LEFT JOIN all_mail m ON ma.mail_id=m.mail_id WHERE m.mail_id IS NULL); (SELECT ma.mail_id FROM mail_addresses ma LEFT JOIN all_mail m ON ma.mail_id=m.mail_id WHERE m.mail_id IS NULL);
schema_0_9_10_upgrade_notes.1225754253.txt.gz · Last modified: 2008/11/03 23:17 by daniel