From: Steve Sutton Date: Tue, 29 Jul 2014 20:02:41 +0000 (-0400) Subject: contact sql X-Git-Tag: v1.1.0^2^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=15917f4a9836aad072545d83ef6cf2b0b6cf28cf;p=web%2FBigFore.git contact sql script for setting contact types for old records --- diff --git a/Toolkit/Contacts/Database/updateContactTypes.sql b/Toolkit/Contacts/Database/updateContactTypes.sql new file mode 100644 index 0000000..38f74ff --- /dev/null +++ b/Toolkit/Contacts/Database/updateContactTypes.sql @@ -0,0 +1,6 @@ +-- +-- Update old contacts with the contact types +-- + +UPDATE contacts.contact SET contact_type = ':5:' WHERE arrival IS NOT NULL AND mail_ok = true AND (contact_type = '' OR contact_type IS NULL); +UPDATE contacts.contact SET contact_type = ':2:' WHERE arrival IS NULL AND mail_ok = true AND (email IS NOT NULL OR email != '') AND (contact_type = '' OR contact_type IS NULL); \ No newline at end of file