liquid_feedback_core
view update/core-update.beta23-beta24.sql @ 113:76ffbafb23b5
Work on event and notification system; Added more "issue_state"s; Replaced "ignored_issue" table; Removal of sessions in "delete_member" function
- "state" column of table "event" is now always filled
- splitted revocation state into 3 new "issue_state"s:
- 'canceled_revoked_before_accepted'
- 'canceled_after_revocation_during_discussion'
- 'canceled_after_revocation_during_verification'
- Added columns "notify_level" and "notify_event_id" to "member" table
- Replaced view "ignored_issue" by three new views:
- TABLE "ignored_member"
- TABLE "ignored_initiative"
- TABLE "non_voter"
- Function "delete_member" now removes "session"s
- Added member specific views on events:
- VIEW "event_seen_by_member"
- VIEW "pending_notification"
- "state" column of table "event" is now always filled
- splitted revocation state into 3 new "issue_state"s:
- 'canceled_revoked_before_accepted'
- 'canceled_after_revocation_during_discussion'
- 'canceled_after_revocation_during_verification'
- Added columns "notify_level" and "notify_event_id" to "member" table
- Replaced view "ignored_issue" by three new views:
- TABLE "ignored_member"
- TABLE "ignored_initiative"
- TABLE "non_voter"
- Function "delete_member" now removes "session"s
- Added member specific views on events:
- VIEW "event_seen_by_member"
- VIEW "pending_notification"
| author | jbe | 
|---|---|
| date | Sat Mar 05 22:05:13 2011 +0100 (2011-03-05) | 
| parents | c78ab22c4870 | 
| children | 
 line source
     1 BEGIN;
     3 CREATE OR REPLACE VIEW "liquid_feedback_version" AS
     4   SELECT * FROM (VALUES ('beta24', NULL, NULL, NULL))
     5   AS "subquery"("string", "major", "minor", "revision");
     7 COMMENT ON TABLE "setting" IS 'Place to store a frontend specific setting for members as a string';
     9 COMMENT ON TABLE "member_relation_setting" IS 'Place to store a frontend specific setting related to relations between members as a string';
    11 CREATE OR REPLACE FUNCTION "delete_private_data"()
    12   RETURNS VOID
    13   LANGUAGE 'plpgsql' VOLATILE AS $$
    14     DECLARE
    15       "issue_id_v" "issue"."id"%TYPE;
    16     BEGIN
    17       UPDATE "member" SET
    18         "login"                        = 'login' || "id"::text,
    19         "password"                     = NULL,
    20         "notify_email"                 = NULL,
    21         "notify_email_unconfirmed"     = NULL,
    22         "notify_email_secret"          = NULL,
    23         "notify_email_secret_expiry"   = NULL,
    24         "password_reset_secret"        = NULL,
    25         "password_reset_secret_expiry" = NULL,
    26         "organizational_unit"          = NULL,
    27         "internal_posts"               = NULL,
    28         "realname"                     = NULL,
    29         "birthday"                     = NULL,
    30         "address"                      = NULL,
    31         "email"                        = NULL,
    32         "xmpp_address"                 = NULL,
    33         "website"                      = NULL,
    34         "phone"                        = NULL,
    35         "mobile_phone"                 = NULL,
    36         "profession"                   = NULL,
    37         "external_memberships"         = NULL,
    38         "external_posts"               = NULL,
    39         "statement"                    = NULL;
    40       -- "text_search_data" is updated by triggers
    41       UPDATE "member_history" SET "login" = 'login' || "member_id"::text;
    42       DELETE FROM "invite_code";
    43       DELETE FROM "setting";
    44       DELETE FROM "setting_map";
    45       DELETE FROM "member_relation_setting";
    46       DELETE FROM "member_image";
    47       DELETE FROM "contact";
    48       DELETE FROM "session";
    49       DELETE FROM "area_setting";
    50       DELETE FROM "issue_setting";
    51       DELETE FROM "initiative_setting";
    52       DELETE FROM "suggestion_setting";
    53       DELETE FROM "direct_voter" USING "issue"
    54         WHERE "direct_voter"."issue_id" = "issue"."id"
    55         AND "issue"."closed" ISNULL;
    56       RETURN;
    57     END;
    58   $$;
    60 COMMIT;
