# HG changeset patch # User jbe # Date 1361401089 -3600 # Node ID c8289a674ef292537ac8e07e38fbe34a999870d8 # Parent a7537038640d5c290dada6d4a0dfa62c1976ae74 Removed deprecated timeline views diff -r a7537038640d -r c8289a674ef2 core.sql --- a/core.sql Wed Feb 20 02:56:49 2013 +0100 +++ b/core.sql Wed Feb 20 23:58:09 2013 +0100 @@ -2278,144 +2278,6 @@ COMMENT ON VIEW "selected_event_seen_by_member" IS 'Events as seen by a member, depending on its memberships, interests, support and members "notify_level"'; -CREATE TYPE "timeline_event" AS ENUM ( - 'issue_created', - 'issue_canceled', - 'issue_accepted', - 'issue_half_frozen', - 'issue_finished_without_voting', - 'issue_voting_started', - 'issue_finished_after_voting', - 'initiative_created', - 'initiative_revoked', - 'draft_created', - 'suggestion_created'); - -COMMENT ON TYPE "timeline_event" IS 'Types of event in timeline tables (DEPRECATED)'; - - -CREATE VIEW "timeline_issue" AS - SELECT - "created" AS "occurrence", - 'issue_created'::"timeline_event" AS "event", - "id" AS "issue_id" - FROM "issue" - UNION ALL - SELECT - "closed" AS "occurrence", - 'issue_canceled'::"timeline_event" AS "event", - "id" AS "issue_id" - FROM "issue" WHERE "closed" NOTNULL AND "fully_frozen" ISNULL - UNION ALL - SELECT - "accepted" AS "occurrence", - 'issue_accepted'::"timeline_event" AS "event", - "id" AS "issue_id" - FROM "issue" WHERE "accepted" NOTNULL - UNION ALL - SELECT - "half_frozen" AS "occurrence", - 'issue_half_frozen'::"timeline_event" AS "event", - "id" AS "issue_id" - FROM "issue" WHERE "half_frozen" NOTNULL - UNION ALL - SELECT - "fully_frozen" AS "occurrence", - 'issue_voting_started'::"timeline_event" AS "event", - "id" AS "issue_id" - FROM "issue" - WHERE "fully_frozen" NOTNULL - AND ("closed" ISNULL OR "closed" != "fully_frozen") - UNION ALL - SELECT - "closed" AS "occurrence", - CASE WHEN "fully_frozen" = "closed" THEN - 'issue_finished_without_voting'::"timeline_event" - ELSE - 'issue_finished_after_voting'::"timeline_event" - END AS "event", - "id" AS "issue_id" - FROM "issue" WHERE "closed" NOTNULL AND "fully_frozen" NOTNULL; - -COMMENT ON VIEW "timeline_issue" IS 'Helper view for "timeline" view (DEPRECATED)'; - - -CREATE VIEW "timeline_initiative" AS - SELECT - "created" AS "occurrence", - 'initiative_created'::"timeline_event" AS "event", - "id" AS "initiative_id" - FROM "initiative" - UNION ALL - SELECT - "revoked" AS "occurrence", - 'initiative_revoked'::"timeline_event" AS "event", - "id" AS "initiative_id" - FROM "initiative" WHERE "revoked" NOTNULL; - -COMMENT ON VIEW "timeline_initiative" IS 'Helper view for "timeline" view (DEPRECATED)'; - - -CREATE VIEW "timeline_draft" AS - SELECT - "created" AS "occurrence", - 'draft_created'::"timeline_event" AS "event", - "id" AS "draft_id" - FROM "draft"; - -COMMENT ON VIEW "timeline_draft" IS 'Helper view for "timeline" view (DEPRECATED)'; - - -CREATE VIEW "timeline_suggestion" AS - SELECT - "created" AS "occurrence", - 'suggestion_created'::"timeline_event" AS "event", - "id" AS "suggestion_id" - FROM "suggestion"; - -COMMENT ON VIEW "timeline_suggestion" IS 'Helper view for "timeline" view (DEPRECATED)'; - - -CREATE VIEW "timeline" AS - SELECT - "occurrence", - "event", - "issue_id", - NULL AS "initiative_id", - NULL::INT8 AS "draft_id", -- TODO: Why do we need a type-cast here? Is this due to 32 bit architecture? - NULL::INT8 AS "suggestion_id" - FROM "timeline_issue" - UNION ALL - SELECT - "occurrence", - "event", - NULL AS "issue_id", - "initiative_id", - NULL AS "draft_id", - NULL AS "suggestion_id" - FROM "timeline_initiative" - UNION ALL - SELECT - "occurrence", - "event", - NULL AS "issue_id", - NULL AS "initiative_id", - "draft_id", - NULL AS "suggestion_id" - FROM "timeline_draft" - UNION ALL - SELECT - "occurrence", - "event", - NULL AS "issue_id", - NULL AS "initiative_id", - NULL AS "draft_id", - "suggestion_id" - FROM "timeline_suggestion"; - -COMMENT ON VIEW "timeline" IS 'Aggregation of different events in the system (DEPRECATED)'; - - ------------------------------------------------------ -- Row set returning function for delegation chains --