Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug 803209 Support for garbage collection reporting
- Loading branch information
1 parent
9901bd0
commit 459939e
Showing
10 changed files
with
173 additions
and
43 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,73 @@ | ||
"""bug 803209 -- add garbage collection count to TCBS | ||
Revision ID: 2b285e76f71d | ||
Revises: 8894c185715 | ||
Create Date: 2013-06-11 12:46:09.637058 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '2b285e76f71d' | ||
down_revision = '8894c185715' | ||
|
||
import os | ||
import sqlalchemy as sa | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
from sqlalchemy import types | ||
from sqlalchemy.sql import table, column | ||
from sqlalchemy.dialects import postgresql | ||
|
||
class CITEXT(types.UserDefinedType): | ||
name = 'citext' | ||
|
||
def get_col_spec(self): | ||
return 'CITEXT' | ||
|
||
def bind_processor(self, dialect): | ||
def process(value): | ||
return value | ||
return process | ||
|
||
def result_processor(self, dialect, coltype): | ||
def process(value): | ||
return value | ||
return process | ||
|
||
def __repr__(self): | ||
return "citext" | ||
|
||
class JSON(types.UserDefinedType): | ||
name = 'json' | ||
|
||
def get_col_spec(self): | ||
return 'JSON' | ||
|
||
def bind_processor(self, dialect): | ||
def process(value): | ||
return value | ||
return process | ||
|
||
def result_processor(self, dialect, coltype): | ||
def process(value): | ||
return value | ||
return process | ||
|
||
def __repr__(self): | ||
return "json" | ||
|
||
def upgrade(): | ||
op.add_column(u'tcbs', sa.Column(u'is_gc_count', sa.INTEGER(), server_default='0', nullable=False)) | ||
op.add_column(u'tcbs_build', sa.Column(u'is_gc_count', sa.INTEGER(), server_default='0', nullable=False)) | ||
app_path=os.getcwd() | ||
procs = [ | ||
'backfill_matviews.sql', | ||
'update_tcbs.sql' | ||
] | ||
for myfile in [app_path + '/socorro/external/postgresql/raw_sql/procs/' + line for line in procs]: | ||
proc = open(myfile, 'r').read() | ||
op.execute(proc) | ||
|
||
def downgrade(): | ||
op.drop_column(u'tcbs_build', u'is_gc_count') | ||
op.drop_column(u'tcbs', u'is_gc_count') |
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ suds==0.4 | |
thrift==0.8.0 | ||
web.py==0.36 | ||
requests==1.2.3 | ||
pgxnclient==1.2.1 |
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
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
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