liquid_feedback_core
diff update/core-update.v2.0.4-v2.0.5.sql @ 228:6e273a6ed235
Delete "admin_comment" in function "delete_private_data"; Update script for v2.0.5
author | jbe |
---|---|
date | Mon Mar 05 18:06:46 2012 +0100 (2012-03-05) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/update/core-update.v2.0.4-v2.0.5.sql Mon Mar 05 18:06:46 2012 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +BEGIN; 1.5 + 1.6 +CREATE OR REPLACE VIEW "liquid_feedback_version" AS 1.7 + SELECT * FROM (VALUES ('2.0.5', 2, 0, 5)) 1.8 + AS "subquery"("string", "major", "minor", "revision"); 1.9 + 1.10 +CREATE OR REPLACE FUNCTION "delete_private_data"() 1.11 + RETURNS VOID 1.12 + LANGUAGE 'plpgsql' VOLATILE AS $$ 1.13 + BEGIN 1.14 + DELETE FROM "member" WHERE "activated" ISNULL; 1.15 + UPDATE "member" SET 1.16 + "invite_code" = NULL, 1.17 + "admin_comment" = NULL, 1.18 + "last_login" = NULL, 1.19 + "login" = NULL, 1.20 + "password" = NULL, 1.21 + "notify_email" = NULL, 1.22 + "notify_email_unconfirmed" = NULL, 1.23 + "notify_email_secret" = NULL, 1.24 + "notify_email_secret_expiry" = NULL, 1.25 + "notify_email_lock_expiry" = NULL, 1.26 + "password_reset_secret" = NULL, 1.27 + "password_reset_secret_expiry" = NULL, 1.28 + "organizational_unit" = NULL, 1.29 + "internal_posts" = NULL, 1.30 + "realname" = NULL, 1.31 + "birthday" = NULL, 1.32 + "address" = NULL, 1.33 + "email" = NULL, 1.34 + "xmpp_address" = NULL, 1.35 + "website" = NULL, 1.36 + "phone" = NULL, 1.37 + "mobile_phone" = NULL, 1.38 + "profession" = NULL, 1.39 + "external_memberships" = NULL, 1.40 + "external_posts" = NULL, 1.41 + "statement" = NULL; 1.42 + -- "text_search_data" is updated by triggers 1.43 + DELETE FROM "setting"; 1.44 + DELETE FROM "setting_map"; 1.45 + DELETE FROM "member_relation_setting"; 1.46 + DELETE FROM "member_image"; 1.47 + DELETE FROM "contact"; 1.48 + DELETE FROM "ignored_member"; 1.49 + DELETE FROM "area_setting"; 1.50 + DELETE FROM "issue_setting"; 1.51 + DELETE FROM "ignored_initiative"; 1.52 + DELETE FROM "initiative_setting"; 1.53 + DELETE FROM "suggestion_setting"; 1.54 + DELETE FROM "non_voter"; 1.55 + DELETE FROM "direct_voter" USING "issue" 1.56 + WHERE "direct_voter"."issue_id" = "issue"."id" 1.57 + AND "issue"."closed" ISNULL; 1.58 + RETURN; 1.59 + END; 1.60 + $$; 1.61 + 1.62 +COMMIT;