# HG changeset patch # User jbe # Date 1330967206 -3600 # Node ID 6e273a6ed235f87c9450056745f1ccc337c39845 # Parent b719b97232edde25869de723bffb2dde3f5f9bb1 Delete "admin_comment" in function "delete_private_data"; Update script for v2.0.5 diff -r b719b97232ed -r 6e273a6ed235 core.sql --- a/core.sql Thu Mar 01 23:07:05 2012 +0100 +++ b/core.sql Mon Mar 05 18:06:46 2012 +0100 @@ -7,7 +7,7 @@ BEGIN; CREATE VIEW "liquid_feedback_version" AS - SELECT * FROM (VALUES ('2.0.4', 2, 0, 4)) + SELECT * FROM (VALUES ('2.0.5', 2, 0, 5)) AS "subquery"("string", "major", "minor", "revision"); @@ -4164,6 +4164,7 @@ DELETE FROM "member" WHERE "activated" ISNULL; UPDATE "member" SET "invite_code" = NULL, + "admin_comment" = NULL, "last_login" = NULL, "login" = NULL, "password" = NULL, diff -r b719b97232ed -r 6e273a6ed235 update/core-update.v2.0.4-v2.0.5.sql --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/update/core-update.v2.0.4-v2.0.5.sql Mon Mar 05 18:06:46 2012 +0100 @@ -0,0 +1,59 @@ +BEGIN; + +CREATE OR REPLACE VIEW "liquid_feedback_version" AS + SELECT * FROM (VALUES ('2.0.5', 2, 0, 5)) + 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, + "admin_comment" = NULL, + "last_login" = NULL, + "login" = NULL, + "password" = NULL, + "notify_email" = NULL, + "notify_email_unconfirmed" = NULL, + "notify_email_secret" = NULL, + "notify_email_secret_expiry" = NULL, + "notify_email_lock_expiry" = 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, + "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 "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;