liquid_feedback_core

diff update/core-update.beta23-beta24.sql @ 38:c78ab22c4870

Added missing DELETEs in function "delete_private_data"(); Fixed wrong COMMENT statement for table "member_relation_setting"
(includes new file update/core-update.beta23-beta24.sql)
author jbe
date Mon Mar 08 14:23:54 2010 +0100 (2010-03-08)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/update/core-update.beta23-beta24.sql	Mon Mar 08 14:23:54 2010 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +BEGIN;
     1.5 +
     1.6 +CREATE OR REPLACE VIEW "liquid_feedback_version" AS
     1.7 +  SELECT * FROM (VALUES ('beta24', NULL, NULL, NULL))
     1.8 +  AS "subquery"("string", "major", "minor", "revision");
     1.9 +
    1.10 +COMMENT ON TABLE "setting" IS 'Place to store a frontend specific setting for members as a string';
    1.11 +
    1.12 +COMMENT ON TABLE "member_relation_setting" IS 'Place to store a frontend specific setting related to relations between members as a string';
    1.13 +
    1.14 +CREATE OR REPLACE FUNCTION "delete_private_data"()
    1.15 +  RETURNS VOID
    1.16 +  LANGUAGE 'plpgsql' VOLATILE AS $$
    1.17 +    DECLARE
    1.18 +      "issue_id_v" "issue"."id"%TYPE;
    1.19 +    BEGIN
    1.20 +      UPDATE "member" SET
    1.21 +        "login"                        = 'login' || "id"::text,
    1.22 +        "password"                     = NULL,
    1.23 +        "notify_email"                 = NULL,
    1.24 +        "notify_email_unconfirmed"     = NULL,
    1.25 +        "notify_email_secret"          = NULL,
    1.26 +        "notify_email_secret_expiry"   = NULL,
    1.27 +        "password_reset_secret"        = NULL,
    1.28 +        "password_reset_secret_expiry" = NULL,
    1.29 +        "organizational_unit"          = NULL,
    1.30 +        "internal_posts"               = NULL,
    1.31 +        "realname"                     = NULL,
    1.32 +        "birthday"                     = NULL,
    1.33 +        "address"                      = NULL,
    1.34 +        "email"                        = NULL,
    1.35 +        "xmpp_address"                 = NULL,
    1.36 +        "website"                      = NULL,
    1.37 +        "phone"                        = NULL,
    1.38 +        "mobile_phone"                 = NULL,
    1.39 +        "profession"                   = NULL,
    1.40 +        "external_memberships"         = NULL,
    1.41 +        "external_posts"               = NULL,
    1.42 +        "statement"                    = NULL;
    1.43 +      -- "text_search_data" is updated by triggers
    1.44 +      UPDATE "member_history" SET "login" = 'login' || "member_id"::text;
    1.45 +      DELETE FROM "invite_code";
    1.46 +      DELETE FROM "setting";
    1.47 +      DELETE FROM "setting_map";
    1.48 +      DELETE FROM "member_relation_setting";
    1.49 +      DELETE FROM "member_image";
    1.50 +      DELETE FROM "contact";
    1.51 +      DELETE FROM "session";
    1.52 +      DELETE FROM "area_setting";
    1.53 +      DELETE FROM "issue_setting";
    1.54 +      DELETE FROM "initiative_setting";
    1.55 +      DELETE FROM "suggestion_setting";
    1.56 +      DELETE FROM "direct_voter" USING "issue"
    1.57 +        WHERE "direct_voter"."issue_id" = "issue"."id"
    1.58 +        AND "issue"."closed" ISNULL;
    1.59 +      RETURN;
    1.60 +    END;
    1.61 +  $$;
    1.62 +
    1.63 +COMMIT;

Impressum / About Us