# HG changeset patch # User jbe # Date 1262430000 -3600 # Node ID 015825e225caeb6bbd0634bd978103a41eacc7b7 # Parent effdd7a04ea7f6df7ba1f2a474e2db1493f588da Version beta12 Changed function delete_private_data() to delete more data, including tables setting and member_image, for better data protection Bugfix related to linux-sh in shell script lf_export New fields password_reset_secret and password_reset_secret_expiry in member table UNIQUE constraint for notify_email_secret and password_reset_secret fields in member table Database constraint forbids adding yourself as a contact diff -r effdd7a04ea7 -r 015825e225ca core.sql --- a/core.sql Fri Dec 25 12:00:00 2009 +0100 +++ b/core.sql Sat Jan 02 12:00:00 2010 +0100 @@ -6,7 +6,7 @@ BEGIN; CREATE VIEW "liquid_feedback_version" AS - SELECT * FROM (VALUES ('beta11', NULL, NULL, NULL)) + SELECT * FROM (VALUES ('beta12', NULL, NULL, NULL)) AS "subquery"("string", "major", "minor", "revision"); @@ -60,9 +60,11 @@ "active" BOOLEAN NOT NULL DEFAULT TRUE, "admin" BOOLEAN NOT NULL DEFAULT FALSE, "notify_email" TEXT, - "notify_email_unconfirmed" TEXT, - "notify_email_secret" TEXT, - "notify_email_secret_expiry" TIMESTAMPTZ, + "notify_email_unconfirmed" TEXT, + "notify_email_secret" TEXT UNIQUE, + "notify_email_secret_expiry" TIMESTAMPTZ, + "password_reset_secret" TEXT UNIQUE, + "password_reset_secret_expiry" TIMESTAMPTZ, "name" TEXT NOT NULL UNIQUE, "identification" TEXT UNIQUE, "organizational_unit" TEXT, @@ -171,7 +173,9 @@ PRIMARY KEY ("member_id", "other_member_id"), "member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, "other_member_id" INT4 REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE, - "public" BOOLEAN NOT NULL DEFAULT FALSE ); + "public" BOOLEAN NOT NULL DEFAULT FALSE, + CONSTRAINT "cant_save_yourself_as_contact" + CHECK ("member_id" != "other_member_id") ); COMMENT ON TABLE "contact" IS 'Contact lists'; @@ -2303,8 +2307,9 @@ AND "direct_voter"."member_id" ISNULL AND "delegating_voter"."member_id" ISNULL LOOP - INSERT INTO "direct_voter" ("member_id", "issue_id", "autoreject") - VALUES ("member_id_v", "issue_id_p", TRUE); + INSERT INTO "direct_voter" + ("member_id", "issue_id", "weight", "autoreject") VALUES + ("member_id_v", "issue_id_p", 1, TRUE); INSERT INTO "vote" ( "member_id", "issue_id", @@ -2744,15 +2749,34 @@ "issue_id_v" "issue"."id"%TYPE; BEGIN UPDATE "member" SET - "login" = 'login' || "id"::text, - "password" = NULL, - "notify_email" = NULL, - "notify_email_unconfirmed" = NULL, - "notify_email_secret" = NULL, - "notify_email_secret_expiry" = NULL; + "login" = 'login' || "id"::text, + "password" = NULL, + "notify_email" = NULL, + "notify_email_unconfirmed" = NULL, + "notify_email_secret" = NULL, + "notify_email_secret_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 "session"; DELETE FROM "invite_code" WHERE "used" ISNULL; DELETE FROM "contact" WHERE NOT "public"; + DELETE FROM "setting"; + DELETE FROM "member_image"; DELETE FROM "direct_voter" USING "issue" WHERE "direct_voter"."issue_id" = "issue"."id" AND "issue"."closed" ISNULL; diff -r effdd7a04ea7 -r 015825e225ca lf_export --- a/lf_export Fri Dec 25 12:00:00 2009 +0100 +++ b/lf_export Sat Jan 02 12:00:00 2010 +0100 @@ -19,6 +19,7 @@ echo "Dumping and compressing copied database to \"$2\"..." if pg_dump --no-owner --no-privileges "$EXPORT_DBNAME" | gzip -9 > "$2" then + true else retval=4 fi