liquid_feedback_core
annotate update/core-update.beta17-beta18.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 | f0460e206bc6 |
children |
rev | line source |
---|---|
jbe@17 | 1 BEGIN; |
jbe@17 | 2 |
jbe@17 | 3 CREATE OR REPLACE VIEW "liquid_feedback_version" AS |
jbe@17 | 4 SELECT * FROM (VALUES ('beta18', NULL, NULL, NULL)) |
jbe@17 | 5 AS "subquery"("string", "major", "minor", "revision"); |
jbe@17 | 6 |
jbe@17 | 7 CREATE OR REPLACE VIEW "timeline_issue" AS |
jbe@17 | 8 SELECT |
jbe@17 | 9 "created" AS "occurrence", |
jbe@17 | 10 'issue_created'::"timeline_event" AS "event", |
jbe@17 | 11 "id" AS "issue_id" |
jbe@17 | 12 FROM "issue" |
jbe@17 | 13 UNION ALL |
jbe@17 | 14 SELECT |
jbe@17 | 15 "closed" AS "occurrence", |
jbe@17 | 16 'issue_canceled'::"timeline_event" AS "event", |
jbe@17 | 17 "id" AS "issue_id" |
jbe@17 | 18 FROM "issue" WHERE "closed" NOTNULL AND "fully_frozen" ISNULL |
jbe@17 | 19 UNION ALL |
jbe@17 | 20 SELECT |
jbe@17 | 21 "accepted" AS "occurrence", |
jbe@17 | 22 'issue_accepted'::"timeline_event" AS "event", |
jbe@17 | 23 "id" AS "issue_id" |
jbe@17 | 24 FROM "issue" WHERE "accepted" NOTNULL |
jbe@17 | 25 UNION ALL |
jbe@17 | 26 SELECT |
jbe@17 | 27 "half_frozen" AS "occurrence", |
jbe@17 | 28 'issue_half_frozen'::"timeline_event" AS "event", |
jbe@17 | 29 "id" AS "issue_id" |
jbe@17 | 30 FROM "issue" WHERE "half_frozen" NOTNULL |
jbe@17 | 31 UNION ALL |
jbe@17 | 32 SELECT |
jbe@17 | 33 "fully_frozen" AS "occurrence", |
jbe@17 | 34 'issue_voting_started'::"timeline_event" AS "event", |
jbe@17 | 35 "id" AS "issue_id" |
jbe@17 | 36 FROM "issue" |
jbe@17 | 37 WHERE "fully_frozen" NOTNULL |
jbe@17 | 38 AND ("closed" ISNULL OR "closed" != "fully_frozen") |
jbe@17 | 39 UNION ALL |
jbe@17 | 40 SELECT |
jbe@17 | 41 "closed" AS "occurrence", |
jbe@17 | 42 CASE WHEN "fully_frozen" = "closed" THEN |
jbe@17 | 43 'issue_finished_without_voting'::"timeline_event" |
jbe@17 | 44 ELSE |
jbe@17 | 45 'issue_finished_after_voting'::"timeline_event" |
jbe@17 | 46 END AS "event", |
jbe@17 | 47 "id" AS "issue_id" |
jbe@17 | 48 FROM "issue" WHERE "closed" NOTNULL AND "fully_frozen" NOTNULL; |
jbe@17 | 49 |
jbe@17 | 50 COMMIT; |