liquid_feedback_core
changeset 176:b2d87fbb123b
Added constraint "eligible_at_first_rank_is_winner" to "initiative" table
author | jbe |
---|---|
date | Wed Jun 08 14:03:16 2011 +0200 (2011-06-08) |
parents | 62ac82e55a57 |
children | 9975ce3f20ee |
files | core.sql |
line diff
1.1 --- a/core.sql Tue Jun 07 21:30:20 2011 +0200 1.2 +++ b/core.sql Wed Jun 08 14:03:16 2011 +0200 1.3 @@ -593,6 +593,7 @@ 1.4 ("direct_majority" AND "indirect_majority" AND "better_than_status_quo") ), 1.5 CONSTRAINT "winner_must_be_eligible" CHECK ("winner"=FALSE OR "eligible"=TRUE), 1.6 CONSTRAINT "winner_must_have_first_rank" CHECK ("winner"=FALSE OR "rank"=1), 1.7 + CONSTRAINT "eligible_at_first_rank_is_winner" CHECK ("eligible"=FALSE OR "rank"!=1 OR "winner"=TRUE), 1.8 CONSTRAINT "unique_rank_per_issue" UNIQUE ("issue_id", "rank") ); 1.9 CREATE INDEX "initiative_created_idx" ON "initiative" ("created"); 1.10 CREATE INDEX "initiative_revoked_idx" ON "initiative" ("revoked");