Skip to content

Commit

Permalink
Dropping build-date column for 3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkus committed Mar 21, 2012
1 parent f3a186e commit 24cfcb2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sql/upgrade/3.0/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ No Bug
Add function for middleware to retrieve lists of product_versions
from the DB.

729208
Drop redundant build_date column from reports.

...

The above changes should take only a few minutes to deploy.
This upgrade does not require a downtime.
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.
10 changes: 10 additions & 0 deletions sql/upgrade/3.0/drop_reports_build_date.sql
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$;
5 changes: 5 additions & 0 deletions sql/upgrade/3.0/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ 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

Expand Down

0 comments on commit 24cfcb2

Please sign in to comment.