liquid_feedback_core

view update/core-update.v1.0.0-v1.0.1.sql @ 139:e3bfa2d7954c

Always ensure stable voting results by disqualifying certain initiatives, and bugfix related to setting "issue_state" in "calculate_ranks"

- Removed column "majority_indirect" from table "policy"
- Removed column "eligible" from table "initiative" ("eligible" can be calculated as "attainable"=TRUE AND "favored"=TRUE AND "disqualified"=FALSE)
- Split "rank" column of table "initiative" into columns "preliminary_rank" and "final_rank"
- Added column "disqualified" to table "initiative"
- Removed column "promising" from table "initiative"
- Removed constraints from table "initiative"
- Updated functions "close_voting" and "calculate_ranks"
- Added TODO notice in function "clean_issue"
author jbe
date Sun May 29 19:51:16 2011 +0200 (2011-05-29)
parents 74c985baf082
children
line source
1 BEGIN;
3 CREATE OR REPLACE VIEW "liquid_feedback_version" AS
4 SELECT * FROM (VALUES ('1.0.1', 1, 0, 1))
5 AS "subquery"("string", "major", "minor", "revision");
7 CREATE OR REPLACE FUNCTION "delete_member_data"("member_id_p" "member"."id"%TYPE)
8 RETURNS VOID
9 LANGUAGE 'plpgsql' VOLATILE AS $$
10 BEGIN
11 UPDATE "member" SET
12 "login" = NULL,
13 "password" = NULL,
14 "notify_email" = NULL,
15 "notify_email_unconfirmed" = NULL,
16 "notify_email_secret" = NULL,
17 "notify_email_secret_expiry" = NULL,
18 "password_reset_secret" = NULL,
19 "password_reset_secret_expiry" = NULL,
20 "organizational_unit" = NULL,
21 "internal_posts" = NULL,
22 "realname" = NULL,
23 "birthday" = NULL,
24 "address" = NULL,
25 "email" = NULL,
26 "xmpp_address" = NULL,
27 "website" = NULL,
28 "phone" = NULL,
29 "mobile_phone" = NULL,
30 "profession" = NULL,
31 "external_memberships" = NULL,
32 "external_posts" = NULL,
33 "statement" = NULL
34 WHERE "id" = "member_id_p";
35 -- "text_search_data" is updated by triggers
36 UPDATE "member_history" SET "login" = NULL
37 WHERE "member_id" = "member_id_p";
38 DELETE FROM "setting" WHERE "member_id" = "member_id_p";
39 DELETE FROM "setting_map" WHERE "member_id" = "member_id_p";
40 DELETE FROM "member_relation_setting" WHERE "member_id" = "member_id_p";
41 DELETE FROM "member_image" WHERE "member_id" = "member_id_p";
42 DELETE FROM "contact" WHERE "member_id" = "member_id_p";
43 DELETE FROM "delegation" WHERE "truster_id" = "member_id_p";
44 DELETE FROM "area_setting" WHERE "member_id" = "member_id_p";
45 DELETE FROM "issue_setting" WHERE "member_id" = "member_id_p";
46 DELETE FROM "initiative_setting" WHERE "member_id" = "member_id_p";
47 DELETE FROM "suggestion_setting" WHERE "member_id" = "member_id_p";
48 RETURN;
49 END;
50 $$;
52 COMMIT;

Impressum / About Us