liquid_feedback_core
changeset 291:86f231bd6906
Issues may have an admission_time set to NULL
author | jbe |
---|---|
date | Mon Aug 20 03:28:45 2012 +0200 (2012-08-20) |
parents | 2301a1f2acfa |
children | 3de42ea02dc2 |
files | core.sql update/core-update.v2.0.11-v2.1.0.sql |
line diff
1.1 --- a/core.sql Sun Aug 19 23:37:37 2012 +0200 1.2 +++ b/core.sql Mon Aug 20 03:28:45 2012 +0200 1.3 @@ -504,7 +504,7 @@ 1.4 "closed" TIMESTAMPTZ, 1.5 "ranks_available" BOOLEAN NOT NULL DEFAULT FALSE, 1.6 "cleaned" TIMESTAMPTZ, 1.7 - "admission_time" INTERVAL NOT NULL, 1.8 + "admission_time" INTERVAL, 1.9 "discussion_time" INTERVAL NOT NULL, 1.10 "verification_time" INTERVAL NOT NULL, 1.11 "voting_time" INTERVAL NOT NULL, 1.12 @@ -513,6 +513,8 @@ 1.13 "population" INT4, 1.14 "voter_count" INT4, 1.15 "status_quo_schulze_rank" INT4, 1.16 + CONSTRAINT "admission_time_not_null_unless_instantly_accepted" CHECK ( 1.17 + "admission_time" NOTNULL OR ("accepted" NOTNULL AND "accepted" = "created") ), 1.18 CONSTRAINT "valid_state" CHECK (( 1.19 ("accepted" ISNULL AND "half_frozen" ISNULL AND "fully_frozen" ISNULL AND "closed" ISNULL AND "ranks_available" = FALSE) OR 1.20 ("accepted" ISNULL AND "half_frozen" ISNULL AND "fully_frozen" ISNULL AND "closed" NOTNULL AND "ranks_available" = FALSE) OR
2.1 --- a/update/core-update.v2.0.11-v2.1.0.sql Sun Aug 19 23:37:37 2012 +0200 2.2 +++ b/update/core-update.v2.0.11-v2.1.0.sql Mon Aug 20 03:28:45 2012 +0200 2.3 @@ -33,6 +33,10 @@ 2.4 "verification_time" ISNULL AND "voting_time" ISNULL ) ); 2.5 COMMENT ON COLUMN "policy"."polling" IS 'TRUE = special policy for non-user-generated issues without issue quorum, where certain initiatives (those having the "polling" flag set) do not need to pass the initiative quorum; "admission_time" MUST be set to NULL, the other timings may be set to NULL altogether, allowing individual timing for those issues'; 2.6 2.7 +ALTER TABLE "issue" ALTER COLUMN "admission_time" DROP NOT NULL; 2.8 +ALTER TABLE "issue" ADD CONSTRAINT "admission_time_not_null_unless_instantly_accepted" CHECK ( 2.9 + "admission_time" NOTNULL OR ("accepted" NOTNULL AND "accepted" = "created") ); 2.10 + 2.11 ALTER TABLE "initiative" ADD COLUMN "polling" BOOLEAN NOT NULL DEFAULT FALSE; 2.12 COMMENT ON COLUMN "initiative"."polling" IS 'Initiative does not need to pass the initiative quorum (see "policy"."polling")'; 2.13