From 15917f4a9836aad072545d83ef6cf2b0b6cf28cf Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 29 Jul 2014 16:02:41 -0400 Subject: [PATCH] contact sql script for setting contact types for old records --- Toolkit/Contacts/Database/updateContactTypes.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Toolkit/Contacts/Database/updateContactTypes.sql 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 -- 2.17.1