forked from mozilla-services/socorro
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mozilla-services#448 from jberkus/master
3.0 new function get_product_version_ids, drop build_date
- Loading branch information
Showing
5 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
3.0 Database Updates | ||
==================== | ||
|
||
This batch makes the following database changes: | ||
|
||
No Bug | ||
Add function for middleware to retrieve lists of product_versions | ||
from the DB. | ||
|
||
729208 | ||
Drop redundant build_date column from reports. | ||
|
||
... | ||
|
||
Bug 729208 may require locking on reports, and thus require a brief (5 minutes) processor downtime. | ||
Aside from locking, neither should take more than a couple minutes to run. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
\set ON_ERROR_STOP 1 | ||
|
||
DO $f$ | ||
BEGIN | ||
|
||
PERFORM try_lock_table('reports','ACCESS EXCLUSIVE'); | ||
|
||
ALTER TABLE reports DROP COLUMN build_date; | ||
|
||
END;$f$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
\set ON_ERROR_STOP 1 | ||
|
||
CREATE OR REPLACE FUNCTION get_product_version_ids ( | ||
product CITEXT, | ||
VARIADIC versions CITEXT[] | ||
) | ||
returns INT[] | ||
language sql | ||
as $f$ | ||
SELECT array_agg(product_version_id) | ||
FROM product_versions | ||
WHERE product_name = $1 | ||
AND version_string = ANY ( $2 ); | ||
$f$; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
#please see README | ||
|
||
set -e | ||
|
||
CURDIR=$(dirname $0) | ||
VERSION=3.0 | ||
|
||
#echo '*********************************************************' | ||
#echo 'support functions' | ||
#psql -f ${CURDIR}/support_functions.sql breakpad | ||
|
||
echo '*********************************************************' | ||
echo 'add middleware function for retrieving lists of product-versions' | ||
echo 'no bug' | ||
psql -f ${CURDIR}/get_product_version_ids.sql breakpad | ||
|
||
echo '*********************************************************' | ||
echo 'drop build_date column from reports' | ||
echo 'bug #729208' | ||
psql -f ${CURDIR}/drop_reports_build_date.sql breakpad | ||
|
||
#change version in DB | ||
psql -c "SELECT update_socorro_db_version( '$VERSION' )" breakpad | ||
|
||
echo "$VERSION upgrade done" | ||
|
||
exit 0 |