liquid_feedback_core

changeset 226:10a231cfd585 v2.0.4

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 b719b97232ed
files core.sql update/core-update.v2.0.3-v2.0.4.sql
line diff
     1.1 --- a/core.sql	Tue Feb 28 11:59:19 2012 +0100
     1.2 +++ b/core.sql	Tue Feb 28 15:54:39 2012 +0100
     1.3 @@ -4161,6 +4161,7 @@
     1.4    RETURNS VOID
     1.5    LANGUAGE 'plpgsql' VOLATILE AS $$
     1.6      BEGIN
     1.7 +      DELETE FROM "member" WHERE "activated" ISNULL;
     1.8        UPDATE "member" SET
     1.9          "invite_code"                  = NULL,
    1.10          "last_login"                   = NULL,
     2.1 --- a/update/core-update.v2.0.3-v2.0.4.sql	Tue Feb 28 11:59:19 2012 +0100
     2.2 +++ b/update/core-update.v2.0.3-v2.0.4.sql	Tue Feb 28 15:54:39 2012 +0100
     2.3 @@ -120,4 +120,56 @@
     2.4    AND "ignored_initiative"."member_id" ISNULL;
     2.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"';
     2.6  
     2.7 +-- delete non-activated members in function "delete_private_data":
     2.8 +CREATE OR REPLACE FUNCTION "delete_private_data"()
     2.9 +  RETURNS VOID
    2.10 +  LANGUAGE 'plpgsql' VOLATILE AS $$
    2.11 +    BEGIN
    2.12 +      DELETE FROM "member" WHERE "activated" ISNULL;
    2.13 +      UPDATE "member" SET
    2.14 +        "invite_code"                  = NULL,
    2.15 +        "last_login"                   = NULL,
    2.16 +        "login"                        = NULL,
    2.17 +        "password"                     = NULL,
    2.18 +        "notify_email"                 = NULL,
    2.19 +        "notify_email_unconfirmed"     = NULL,
    2.20 +        "notify_email_secret"          = NULL,
    2.21 +        "notify_email_secret_expiry"   = NULL,
    2.22 +        "notify_email_lock_expiry"     = NULL,
    2.23 +        "password_reset_secret"        = NULL,
    2.24 +        "password_reset_secret_expiry" = NULL,
    2.25 +        "organizational_unit"          = NULL,
    2.26 +        "internal_posts"               = NULL,
    2.27 +        "realname"                     = NULL,
    2.28 +        "birthday"                     = NULL,
    2.29 +        "address"                      = NULL,
    2.30 +        "email"                        = NULL,
    2.31 +        "xmpp_address"                 = NULL,
    2.32 +        "website"                      = NULL,
    2.33 +        "phone"                        = NULL,
    2.34 +        "mobile_phone"                 = NULL,
    2.35 +        "profession"                   = NULL,
    2.36 +        "external_memberships"         = NULL,
    2.37 +        "external_posts"               = NULL,
    2.38 +        "statement"                    = NULL;
    2.39 +      -- "text_search_data" is updated by triggers
    2.40 +      DELETE FROM "setting";
    2.41 +      DELETE FROM "setting_map";
    2.42 +      DELETE FROM "member_relation_setting";
    2.43 +      DELETE FROM "member_image";
    2.44 +      DELETE FROM "contact";
    2.45 +      DELETE FROM "ignored_member";
    2.46 +      DELETE FROM "area_setting";
    2.47 +      DELETE FROM "issue_setting";
    2.48 +      DELETE FROM "ignored_initiative";
    2.49 +      DELETE FROM "initiative_setting";
    2.50 +      DELETE FROM "suggestion_setting";
    2.51 +      DELETE FROM "non_voter";
    2.52 +      DELETE FROM "direct_voter" USING "issue"
    2.53 +        WHERE "direct_voter"."issue_id" = "issue"."id"
    2.54 +        AND "issue"."closed" ISNULL;
    2.55 +      RETURN;
    2.56 +    END;
    2.57 +  $$;
    2.58 +
    2.59  COMMIT;

Impressum / About Us