~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to database/schema/patch-2208-75-1.sql

  • Committer: Robert Collins
  • Date: 2011-07-13 09:50:14 UTC
  • mto: This revision was merged to the branch mainline in revision 13411.
  • Revision ID: robertc@robertcollins.net-20110713095014-qanvyhb5ua2dcliw
Correct the implementation of bug_summary_flush_temp_journal to journal things for real - reinstate the -68-4 version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- Copyright 2011 Canonical Ltd.  This software is licensed under the
 
2
-- GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
SET client_min_messages=ERROR;
 
5
 
 
6
 
 
7
CREATE OR REPLACE FUNCTION bug_summary_flush_temp_journal() RETURNS VOID
 
8
LANGUAGE plpgsql VOLATILE AS
 
9
$$
 
10
DECLARE
 
11
    d bugsummary%ROWTYPE;
 
12
BEGIN
 
13
    -- may get called even though no summaries were made (for simplicity in the
 
14
    -- callers)
 
15
    PERFORM ensure_bugsummary_temp_journal();
 
16
    FOR d IN SELECT * FROM bugsummary_temp_journal LOOP
 
17
        PERFORM bugsummary_journal_ins(d);
 
18
    END LOOP;
 
19
    TRUNCATE bugsummary_temp_journal;
 
20
END;
 
21
$$;
 
22
 
 
23
COMMENT ON FUNCTION bug_summary_flush_temp_journal() IS
 
24
'flush the temporary bugsummary journal into the bugsummaryjournal table';
 
25
 
 
26
 
 
27
INSERT INTO LaunchpadDatabaseRevision VALUES (2208, 75, 1);