liquid_feedback_core
diff update/core-update.v2.0.3-v2.0.4.sql @ 226:10a231cfd585
Delete non-activated members in function "delete_private_data"
author | jbe |
---|---|
date | Tue Feb 28 15:54:39 2012 +0100 (2012-02-28) |
parents | 18e1cd384528 |
children |
line diff
1.1 --- a/update/core-update.v2.0.3-v2.0.4.sql Tue Feb 28 11:59:19 2012 +0100 1.2 +++ b/update/core-update.v2.0.3-v2.0.4.sql Tue Feb 28 15:54:39 2012 +0100 1.3 @@ -120,4 +120,56 @@ 1.4 AND "ignored_initiative"."member_id" ISNULL; 1.5 COMMENT ON VIEW "selected_event_seen_by_member" IS 'Events as seen by a member, depending on its memberships, interests, support and members "notify_level"'; 1.6 1.7 +-- delete non-activated members in function "delete_private_data": 1.8 +CREATE OR REPLACE FUNCTION "delete_private_data"() 1.9 + RETURNS VOID 1.10 + LANGUAGE 'plpgsql' VOLATILE AS $$ 1.11 + BEGIN 1.12 + DELETE FROM "member" WHERE "activated" ISNULL; 1.13 + UPDATE "member" SET 1.14 + "invite_code" = NULL, 1.15 + "last_login" = NULL, 1.16 + "login" = NULL, 1.17 + "password" = NULL, 1.18 + "notify_email" = NULL, 1.19 + "notify_email_unconfirmed" = NULL, 1.20 + "notify_email_secret" = NULL, 1.21 + "notify_email_secret_expiry" = NULL, 1.22 + "notify_email_lock_expiry" = NULL, 1.23 + "password_reset_secret" = NULL, 1.24 + "password_reset_secret_expiry" = NULL, 1.25 + "organizational_unit" = NULL, 1.26 + "internal_posts" = NULL, 1.27 + "realname" = NULL, 1.28 + "birthday" = NULL, 1.29 + "address" = NULL, 1.30 + "email" = NULL, 1.31 + "xmpp_address" = NULL, 1.32 + "website" = NULL, 1.33 + "phone" = NULL, 1.34 + "mobile_phone" = NULL, 1.35 + "profession" = NULL, 1.36 + "external_memberships" = NULL, 1.37 + "external_posts" = NULL, 1.38 + "statement" = NULL; 1.39 + -- "text_search_data" is updated by triggers 1.40 + DELETE FROM "setting"; 1.41 + DELETE FROM "setting_map"; 1.42 + DELETE FROM "member_relation_setting"; 1.43 + DELETE FROM "member_image"; 1.44 + DELETE FROM "contact"; 1.45 + DELETE FROM "ignored_member"; 1.46 + DELETE FROM "area_setting"; 1.47 + DELETE FROM "issue_setting"; 1.48 + DELETE FROM "ignored_initiative"; 1.49 + DELETE FROM "initiative_setting"; 1.50 + DELETE FROM "suggestion_setting"; 1.51 + DELETE FROM "non_voter"; 1.52 + DELETE FROM "direct_voter" USING "issue" 1.53 + WHERE "direct_voter"."issue_id" = "issue"."id" 1.54 + AND "issue"."closed" ISNULL; 1.55 + RETURN; 1.56 + END; 1.57 + $$; 1.58 + 1.59 COMMIT;