liquid_feedback_core

changeset 543:4e0ee8416bbc

Updates for "delete_member" and "delete_private_data" functions
author jbe
date Fri Jul 14 20:46:31 2017 +0200 (2017-07-14)
parents f5c5d2b12726
children ff2c21f883ce
files core.sql update/core-update.v3.2.2-v4.0.0.sql
line diff
     1.1 --- a/core.sql	Fri Jul 14 20:27:33 2017 +0200
     1.2 +++ b/core.sql	Fri Jul 14 20:46:31 2017 +0200
     1.3 @@ -6220,16 +6220,23 @@
     1.4          "notification_sample_size"     = 0,
     1.5          "notification_dow"             = NULL,
     1.6          "notification_hour"            = NULL,
     1.7 +        "notification_sent"            = NULL,
     1.8          "login_recovery_expiry"        = NULL,
     1.9          "password_reset_secret"        = NULL,
    1.10          "password_reset_secret_expiry" = NULL,
    1.11          "location"                     = NULL
    1.12          WHERE "id" = "member_id_p";
    1.13        -- "text_search_data" is updated by triggers
    1.14 +      DELETE FROM "member_profile"     WHERE "member_id" = "member_id_p";
    1.15 +      DELETE FROM "rendered_member_statement" WHERE "member_id" = "member_id_p";
    1.16        DELETE FROM "member_image"       WHERE "member_id" = "member_id_p";
    1.17        DELETE FROM "contact"            WHERE "member_id" = "member_id_p";
    1.18        DELETE FROM "ignored_member"     WHERE "member_id" = "member_id_p";
    1.19        DELETE FROM "session"            WHERE "member_id" = "member_id_p";
    1.20 +      DELETE FROM "member_application" WHERE "member_id" = "member_id_p";
    1.21 +      DELETE FROM "token"              WHERE "member_id" = "member_id_p";
    1.22 +      DELETE FROM "subscription"       WHERE "member_id" = "member_id_p";
    1.23 +      DELETE FROM "ignored_area"       WHERE "member_id" = "member_id_p";
    1.24        DELETE FROM "ignored_initiative" WHERE "member_id" = "member_id_p";
    1.25        DELETE FROM "delegation"         WHERE "truster_id" = "member_id_p";
    1.26        DELETE FROM "non_voter"          WHERE "member_id" = "member_id_p";
    1.27 @@ -6237,6 +6244,7 @@
    1.28          WHERE "direct_voter"."issue_id" = "issue"."id"
    1.29          AND "issue"."closed" ISNULL
    1.30          AND "member_id" = "member_id_p";
    1.31 +      DELETE FROM "notification_initiative_sent" WHERE "member_id" = "member_id_p";
    1.32        RETURN;
    1.33      END;
    1.34    $$;
    1.35 @@ -6249,6 +6257,7 @@
    1.36    LANGUAGE 'plpgsql' VOLATILE AS $$
    1.37      BEGIN
    1.38        DELETE FROM "temporary_transaction_data";
    1.39 +      DELETE FROM "temporary_suggestion_counts";
    1.40        DELETE FROM "member" WHERE "activated" ISNULL;
    1.41        UPDATE "member" SET
    1.42          "invite_code"                  = NULL,
    1.43 @@ -6272,20 +6281,33 @@
    1.44          "notification_sample_size"     = 0,
    1.45          "notification_dow"             = NULL,
    1.46          "notification_hour"            = NULL,
    1.47 +        "notification_sent"            = NULL,
    1.48          "login_recovery_expiry"        = NULL,
    1.49          "password_reset_secret"        = NULL,
    1.50          "password_reset_secret_expiry" = NULL,
    1.51          "location"                     = NULL;
    1.52        -- "text_search_data" is updated by triggers
    1.53 +      DELETE FROM "member_profile";
    1.54 +      DELETE FROM "rendered_member_statement";
    1.55        DELETE FROM "member_image";
    1.56        DELETE FROM "contact";
    1.57        DELETE FROM "ignored_member";
    1.58        DELETE FROM "session";
    1.59 +      DELETE FROM "system_application";
    1.60 +      DELETE FROM "system_application_redirect_uri";
    1.61 +      DELETE FROM "dynamic_application_scope";
    1.62 +      DELETE FROM "member_application";
    1.63 +      DELETE FROM "token";
    1.64 +      DELETE FROM "subscription";
    1.65 +      DELETE FROM "ignored_area";
    1.66        DELETE FROM "ignored_initiative";
    1.67        DELETE FROM "non_voter";
    1.68        DELETE FROM "direct_voter" USING "issue"
    1.69          WHERE "direct_voter"."issue_id" = "issue"."id"
    1.70          AND "issue"."closed" ISNULL;
    1.71 +      DELETE FROM "event_processed";
    1.72 +      DELETE FROM "notification_initiative_sent";
    1.73 +      DELETE FROM "newsletter";
    1.74        RETURN;
    1.75      END;
    1.76    $$;
     2.1 --- a/update/core-update.v3.2.2-v4.0.0.sql	Fri Jul 14 20:27:33 2017 +0200
     2.2 +++ b/update/core-update.v3.2.2-v4.0.0.sql	Fri Jul 14 20:46:31 2017 +0200
     2.3 @@ -3236,16 +3236,23 @@
     2.4          "notification_sample_size"     = 0,
     2.5          "notification_dow"             = NULL,
     2.6          "notification_hour"            = NULL,
     2.7 +        "notification_sent"            = NULL,
     2.8          "login_recovery_expiry"        = NULL,
     2.9          "password_reset_secret"        = NULL,
    2.10          "password_reset_secret_expiry" = NULL,
    2.11          "location"                     = NULL
    2.12          WHERE "id" = "member_id_p";
    2.13        -- "text_search_data" is updated by triggers
    2.14 +      DELETE FROM "member_profile"     WHERE "member_id" = "member_id_p";
    2.15 +      DELETE FROM "rendered_member_statement" WHERE "member_id" = "member_id_p";
    2.16        DELETE FROM "member_image"       WHERE "member_id" = "member_id_p";
    2.17        DELETE FROM "contact"            WHERE "member_id" = "member_id_p";
    2.18        DELETE FROM "ignored_member"     WHERE "member_id" = "member_id_p";
    2.19        DELETE FROM "session"            WHERE "member_id" = "member_id_p";
    2.20 +      DELETE FROM "member_application" WHERE "member_id" = "member_id_p";
    2.21 +      DELETE FROM "token"              WHERE "member_id" = "member_id_p";
    2.22 +      DELETE FROM "subscription"       WHERE "member_id" = "member_id_p";
    2.23 +      DELETE FROM "ignored_area"       WHERE "member_id" = "member_id_p";
    2.24        DELETE FROM "ignored_initiative" WHERE "member_id" = "member_id_p";
    2.25        DELETE FROM "delegation"         WHERE "truster_id" = "member_id_p";
    2.26        DELETE FROM "non_voter"          WHERE "member_id" = "member_id_p";
    2.27 @@ -3253,6 +3260,7 @@
    2.28          WHERE "direct_voter"."issue_id" = "issue"."id"
    2.29          AND "issue"."closed" ISNULL
    2.30          AND "member_id" = "member_id_p";
    2.31 +      DELETE FROM "notification_initiative_sent" WHERE "member_id" = "member_id_p";
    2.32        RETURN;
    2.33      END;
    2.34    $$;
    2.35 @@ -3263,6 +3271,7 @@
    2.36    LANGUAGE 'plpgsql' VOLATILE AS $$
    2.37      BEGIN
    2.38        DELETE FROM "temporary_transaction_data";
    2.39 +      DELETE FROM "temporary_suggestion_counts";
    2.40        DELETE FROM "member" WHERE "activated" ISNULL;
    2.41        UPDATE "member" SET
    2.42          "invite_code"                  = NULL,
    2.43 @@ -3286,20 +3295,33 @@
    2.44          "notification_sample_size"     = 0,
    2.45          "notification_dow"             = NULL,
    2.46          "notification_hour"            = NULL,
    2.47 +        "notification_sent"            = NULL,
    2.48          "login_recovery_expiry"        = NULL,
    2.49          "password_reset_secret"        = NULL,
    2.50          "password_reset_secret_expiry" = NULL,
    2.51          "location"                     = NULL;
    2.52        -- "text_search_data" is updated by triggers
    2.53 +      DELETE FROM "member_profile";
    2.54 +      DELETE FROM "rendered_member_statement";
    2.55        DELETE FROM "member_image";
    2.56        DELETE FROM "contact";
    2.57        DELETE FROM "ignored_member";
    2.58        DELETE FROM "session";
    2.59 +      DELETE FROM "system_application";
    2.60 +      DELETE FROM "system_application_redirect_uri";
    2.61 +      DELETE FROM "dynamic_application_scope";
    2.62 +      DELETE FROM "member_application";
    2.63 +      DELETE FROM "token";
    2.64 +      DELETE FROM "subscription";
    2.65 +      DELETE FROM "ignored_area";
    2.66        DELETE FROM "ignored_initiative";
    2.67        DELETE FROM "non_voter";
    2.68        DELETE FROM "direct_voter" USING "issue"
    2.69          WHERE "direct_voter"."issue_id" = "issue"."id"
    2.70          AND "issue"."closed" ISNULL;
    2.71 +      DELETE FROM "event_processed";
    2.72 +      DELETE FROM "notification_initiative_sent";
    2.73 +      DELETE FROM "newsletter";
    2.74        RETURN;
    2.75      END;
    2.76    $$;

Impressum / About Us