liquid_feedback_core
view update/core-update.beta21-beta22.sql @ 97:58451b5565ae
Introduced (organizational) units
- New table "unit"
- Each "area" refers to one unit
- "invite_code"s are valid for one or many units
- New table "privilege" stores "voting_right" for units
- Delegation scope 'global' is replaced by delegation scope 'unit'
- View "global_delegation" is replaced by "unit_delegation"
- Removed helper view "active_delegation"
- Checking that members have "voting_right" in several views and functions
- New view "unit_member_count" to update "member_count" column of new unit table
- New argument list for function "delegation_chain"(...) containing "unit_id"
- Renamed column "member_active" to "member_valid" in "delegation_chain_row"
- Modified demo.sql and init.sql to support units
- New table "unit"
- Each "area" refers to one unit
- "invite_code"s are valid for one or many units
- New table "privilege" stores "voting_right" for units
- Delegation scope 'global' is replaced by delegation scope 'unit'
- View "global_delegation" is replaced by "unit_delegation"
- Removed helper view "active_delegation"
- Checking that members have "voting_right" in several views and functions
- New view "unit_member_count" to update "member_count" column of new unit table
- New argument list for function "delegation_chain"(...) containing "unit_id"
- Renamed column "member_active" to "member_valid" in "delegation_chain_row"
- Modified demo.sql and init.sql to support units
| author | jbe | 
|---|---|
| date | Tue Dec 07 00:04:44 2010 +0100 (2010-12-07) | 
| parents | 9970f73c1140 | 
| children | 
 line source
     1 BEGIN;
     2 CREATE OR REPLACE VIEW "liquid_feedback_version" AS
     3   SELECT * FROM (VALUES ('beta22', NULL, NULL, NULL))
     4   AS "subquery"("string", "major", "minor", "revision");
     5 ALTER TABLE "issue" DROP CONSTRAINT "valid_state";
     6 ALTER TABLE "issue" ADD CONSTRAINT "valid_state" CHECK (
     7   ("accepted" ISNULL  AND "half_frozen" ISNULL  AND "fully_frozen" ISNULL  AND "closed" ISNULL  AND "ranks_available" = FALSE) OR
     8   ("accepted" ISNULL  AND "half_frozen" ISNULL  AND "fully_frozen" ISNULL  AND "closed" NOTNULL AND "ranks_available" = FALSE) OR
     9   ("accepted" NOTNULL AND "half_frozen" ISNULL  AND "fully_frozen" ISNULL  AND "closed" ISNULL  AND "ranks_available" = FALSE) OR
    10   ("accepted" NOTNULL AND "half_frozen" ISNULL  AND "fully_frozen" ISNULL  AND "closed" NOTNULL AND "ranks_available" = FALSE) OR
    11   ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" ISNULL  AND "closed" ISNULL  AND "ranks_available" = FALSE) OR
    12   ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" ISNULL  AND "closed" NOTNULL AND "ranks_available" = FALSE) OR
    13   ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" NOTNULL AND "closed" ISNULL  AND "ranks_available" = FALSE) OR
    14   ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" NOTNULL AND "closed" NOTNULL AND "ranks_available" = FALSE) OR
    15   ("accepted" NOTNULL AND "half_frozen" NOTNULL AND "fully_frozen" NOTNULL AND "closed" NOTNULL AND "ranks_available" = TRUE) );
    16 COMMIT;
