liquid_feedback_core
diff core.sql @ 260:878f84407290
Policies with "free_timing"
author | jbe |
---|---|
date | Sun Jul 15 19:30:16 2012 +0200 (2012-07-15) |
parents | 620ec5751a1b |
children | 6b2c80028b47 |
line diff
1.1 --- a/core.sql Sun Jul 15 19:14:39 2012 +0200 1.2 +++ b/core.sql Sun Jul 15 19:30:16 2012 +0200 1.3 @@ -328,6 +328,7 @@ 1.4 "active" BOOLEAN NOT NULL DEFAULT TRUE, 1.5 "name" TEXT NOT NULL UNIQUE, 1.6 "description" TEXT NOT NULL DEFAULT '', 1.7 + "free_timing" BOOLEAN NOT NULL DEFAULT FALSE, 1.8 "admission_time" INTERVAL NOT NULL, 1.9 "discussion_time" INTERVAL NOT NULL, 1.10 "verification_time" INTERVAL NOT NULL, 1.11 @@ -347,13 +348,21 @@ 1.12 "indirect_majority_positive" INT4 NOT NULL DEFAULT 0, 1.13 "indirect_majority_non_negative" INT4 NOT NULL DEFAULT 0, 1.14 "no_reverse_beat_path" BOOLEAN NOT NULL DEFAULT TRUE, 1.15 - "no_multistage_majority" BOOLEAN NOT NULL DEFAULT FALSE ); 1.16 + "no_multistage_majority" BOOLEAN NOT NULL DEFAULT FALSE, 1.17 + CONSTRAINT "timing" CHECK ( 1.18 + ( "free_timing" = FALSE AND 1.19 + "admission_time" NOTNULL AND "discussion_time" NOTNULL AND 1.20 + "verification_time" NOTNULL AND "voting_time" NOTNULL ) OR 1.21 + ( "free_timing" = TRUE AND 1.22 + "admission_time" ISNULL AND "discussion_time" ISNULL AND 1.23 + "verification_time" ISNULL AND "voting_time" ISNULL ) ) ); 1.24 CREATE INDEX "policy_active_idx" ON "policy" ("active"); 1.25 1.26 COMMENT ON TABLE "policy" IS 'Policies for a particular proceeding type (timelimits, quorum)'; 1.27 1.28 COMMENT ON COLUMN "policy"."index" IS 'Determines the order in listings'; 1.29 COMMENT ON COLUMN "policy"."active" IS 'TRUE = policy can be used for new issues'; 1.30 +COMMENT ON COLUMN "policy"."free_timing" IS 'TRUE = special policy for non-user-generated issues without predefined timing (all _time fields must be set to NULL then)'; 1.31 COMMENT ON COLUMN "policy"."admission_time" IS 'Maximum duration of issue state ''admission''; Maximum time an issue stays open without being "accepted"'; 1.32 COMMENT ON COLUMN "policy"."discussion_time" IS 'Duration of issue state ''discussion''; Regular time until an issue is "half_frozen" after being "accepted"'; 1.33 COMMENT ON COLUMN "policy"."verification_time" IS 'Duration of issue state ''verification''; Regular time until an issue is "fully_frozen" (e.g. entering issue state ''voting'') after being "half_frozen"';