# HG changeset patch # User jbe # Date 1331821089 -3600 # Node ID fefc15eb747b2007afea64182f1de3a8594fcff8 # Parent ce62f8451659f601c2e475ba305fa37a0bb73e6b Bugfix: Delete member fields "lang", "notify_level" and "formatting_engine" in function "delete_private_data"; Update script to v2.0.8 diff -r ce62f8451659 -r fefc15eb747b core.sql --- a/core.sql Tue Mar 13 20:25:07 2012 +0100 +++ b/core.sql Thu Mar 15 15:18:09 2012 +0100 @@ -7,7 +7,7 @@ BEGIN; CREATE VIEW "liquid_feedback_version" AS - SELECT * FROM (VALUES ('2.0.5', 2, 0, 5)) + SELECT * FROM (VALUES ('2.0.8', 2, 0, 8)) AS "subquery"("string", "major", "minor", "revision"); @@ -4188,11 +4188,13 @@ "last_login" = NULL, "login" = NULL, "password" = NULL, + "lang" = NULL, "notify_email" = NULL, "notify_email_unconfirmed" = NULL, "notify_email_secret" = NULL, "notify_email_secret_expiry" = NULL, "notify_email_lock_expiry" = NULL, + "notify_level" = NULL, "password_reset_secret" = NULL, "password_reset_secret_expiry" = NULL, "organizational_unit" = NULL, @@ -4208,6 +4210,7 @@ "profession" = NULL, "external_memberships" = NULL, "external_posts" = NULL, + "formatting_engine" = NULL, "statement" = NULL; -- "text_search_data" is updated by triggers DELETE FROM "setting"; diff -r ce62f8451659 -r fefc15eb747b update/core-update.v2.0.7-v2.0.8.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/update/core-update.v2.0.7-v2.0.8.sql Thu Mar 15 15:18:09 2012 +0100 @@ -0,0 +1,64 @@ +BEGIN; + +CREATE OR REPLACE VIEW "liquid_feedback_version" AS + SELECT * FROM (VALUES ('2.0.8', 2, 0, 8)) + AS "subquery"("string", "major", "minor", "revision"); + +CREATE OR REPLACE FUNCTION "delete_private_data"() + RETURNS VOID + LANGUAGE 'plpgsql' VOLATILE AS $$ + BEGIN + DELETE FROM "member" WHERE "activated" ISNULL; + UPDATE "member" SET + "invite_code" = NULL, + "invite_code_expiry" = NULL, + "admin_comment" = NULL, + "last_login" = NULL, + "login" = NULL, + "password" = NULL, + "lang" = NULL, + "notify_email" = NULL, + "notify_email_unconfirmed" = NULL, + "notify_email_secret" = NULL, + "notify_email_secret_expiry" = NULL, + "notify_email_lock_expiry" = NULL, + "notify_level" = NULL, + "password_reset_secret" = NULL, + "password_reset_secret_expiry" = NULL, + "organizational_unit" = NULL, + "internal_posts" = NULL, + "realname" = NULL, + "birthday" = NULL, + "address" = NULL, + "email" = NULL, + "xmpp_address" = NULL, + "website" = NULL, + "phone" = NULL, + "mobile_phone" = NULL, + "profession" = NULL, + "external_memberships" = NULL, + "external_posts" = NULL, + "formatting_engine" = NULL, + "statement" = NULL; + -- "text_search_data" is updated by triggers + DELETE FROM "setting"; + DELETE FROM "setting_map"; + DELETE FROM "member_relation_setting"; + DELETE FROM "member_image"; + DELETE FROM "contact"; + DELETE FROM "ignored_member"; + DELETE FROM "session"; + DELETE FROM "area_setting"; + DELETE FROM "issue_setting"; + DELETE FROM "ignored_initiative"; + DELETE FROM "initiative_setting"; + DELETE FROM "suggestion_setting"; + DELETE FROM "non_voter"; + DELETE FROM "direct_voter" USING "issue" + WHERE "direct_voter"."issue_id" = "issue"."id" + AND "issue"."closed" ISNULL; + RETURN; + END; + $$; + +COMMIT;