From 8e09bde56833c1d7e55b1553d20b0537794d02b9 Mon Sep 17 00:00:00 2001 From: Vasu Nori Date: Wed, 25 Nov 2009 15:38:42 -0800 Subject: [PATCH] change BEFORE triggers to AFTER triggers - to make them work with sqlite 3.6.20 and beyond --- src/com/android/email/provider/EmailProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/provider/EmailProvider.java b/src/com/android/email/provider/EmailProvider.java index 4730f164b..c40f0ac90 100644 --- a/src/com/android/email/provider/EmailProvider.java +++ b/src/com/android/email/provider/EmailProvider.java @@ -369,7 +369,7 @@ public class EmailProvider extends ContentProvider { "; end"); // Change a message's read state - db.execSQL("create trigger unread_message_read before update of " + + db.execSQL("create trigger unread_message_read AFTER update of " + MessageColumns.FLAG_READ + " on " + Message.TABLE_NAME + " when OLD." + MessageColumns.FLAG_READ + "!=NEW." + MessageColumns.FLAG_READ + " begin update " + Mailbox.TABLE_NAME + " set " + MailboxColumns.UNREAD_COUNT + @@ -408,7 +408,7 @@ public class EmailProvider extends ContentProvider { + ");"; db.execSQL("create table " + Account.TABLE_NAME + s); // Deleting an account deletes associated Mailboxes and HostAuth's - db.execSQL("create trigger account_delete before delete on " + Account.TABLE_NAME + + db.execSQL("create trigger account_delete AFTER delete on " + Account.TABLE_NAME + " begin delete from " + Mailbox.TABLE_NAME + " where " + MailboxColumns.ACCOUNT_KEY + "=old." + EmailContent.RECORD_ID + "; delete from " + HostAuth.TABLE_NAME +