Skip to content

Commit

Permalink
bug 773332 Add FlashProcessDump to reports and reports_clean
Browse files Browse the repository at this point in the history
* New SQL script and update README and upgrade.sh for new bug
  • Loading branch information
selenamarie committed Nov 8, 2012
1 parent fd8bd42 commit 7d7d26b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sql/upgrade/28.0/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ This batch makes the following database changes:
bug #807349
Add exploitability to reports table

bug #773332
Add FlashProcessDump to reports and reports_clean

The above changes should take only a few minutes to deploy.
This upgrade does not require a downtime.
31 changes: 31 additions & 0 deletions sql/upgrade/28.0/add_flash_process_dump.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- This Source Code Form is subject to the terms of the Mozilla Public
-- License, v. 2.0. If a copy of the MPL was not distributed with this
-- file, You can obtain one at http://mozilla.org/MPL/2.0/.

\set ON_ERROR_STOP on

DO $f$
BEGIN

PERFORM 1 FROM information_schema.columns
WHERE table_name = 'reports'
AND column_name = 'flash_process_dump';


IF NOT FOUND THEN
ALTER TABLE reports ADD COLUMN flash_process_dump text;
END IF;

PERFORM 1 FROM information_schema.columns
WHERE table_name = 'reports_clean'
AND column_name = 'flash_process_dump';

IF NOT FOUND THEN
CREATE TYPE flash_process_dump_type AS ENUM ('Sandbox', 'Broker');
ALTER TABLE reports_clean ADD COLUMN flash_process_dump flash_process_dump_type;
END IF;

END;
$f$;

COMMIT;
3 changes: 3 additions & 0 deletions sql/upgrade/28.0/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ echo '*********************************************************'
echo 'Add exploitability column to reports'
echo 'bug 807349'
psql -f ${CURDIR}/exploitability_column.sql $DBNAME
echo 'Add FlashProcessDump to reports and reports_clean'
echo 'bug 773332'
psql -f ${CURDIR}/add_flash_process_dump.sql $DBNAME

#change version in DB
psql -c "SELECT update_socorro_db_version( '$VERSION' )" $DBNAME
Expand Down

0 comments on commit 7d7d26b

Please sign in to comment.