liquid_feedback_core

view update/core-update.v2.2.5-v2.2.6.sql @ 408:f7b4457cf1a6

core.sql: Removed "order_in_open_states"
author jbe
date Mon Oct 14 00:23:04 2013 +0200 (2013-10-14)
parents 782eb17c7ad9
children 5f24058af0b8
line source
1 BEGIN;
3 CREATE OR REPLACE VIEW "liquid_feedback_version" AS
4 SELECT * FROM (VALUES ('2.2.6', 2, 2, 6))
5 AS "subquery"("string", "major", "minor", "revision");
7 CREATE TABLE "issue_order" (
8 "id" INT8 PRIMARY KEY, --REFERENCES "issue" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
9 "order_in_admission_state" INT4 );
11 COMMENT ON TABLE "issue_order" IS 'Ordering information for issues that are not stored in the "issue" table to avoid locking of multiple issues at once';
13 COMMENT ON COLUMN "issue_order"."id" IS 'References "issue" ("id") but has no referential integrity trigger associated, due to performance/locking issues';
14 COMMENT ON COLUMN "issue_order"."order_in_admission_state" IS 'To be used for sorting issues within an area, when showing issues in admission state; NULL values sort last; updated by "lf_update_issue_order"';
16 CREATE VIEW "issue_supporter_in_admission_state" AS
17 SELECT DISTINCT
18 "issue"."area_id",
19 "issue"."id" AS "issue_id",
20 "supporter"."member_id",
21 "direct_interest_snapshot"."weight"
22 FROM "issue"
23 JOIN "supporter" ON "supporter"."issue_id" = "issue"."id"
24 JOIN "direct_interest_snapshot"
25 ON "direct_interest_snapshot"."issue_id" = "issue"."id"
26 AND "direct_interest_snapshot"."event" = "issue"."latest_snapshot_event"
27 AND "direct_interest_snapshot"."member_id" = "supporter"."member_id"
28 WHERE "issue"."state" = 'admission'::"issue_state";
30 COMMENT ON VIEW "issue_supporter_in_admission_state" IS 'Helper view for "lf_update_issue_order" to allow a (proportional) ordering of issues within an area';
32 COMMIT;

Impressum / About Us