Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug 972612 - is_gc_count should be per-adu r=selenamarie
- Loading branch information
Showing
3 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
alembic/versions/c1ac31c8fea_fix_bug_972612_is_gc_count_should_be_.py
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,42 @@ | ||
"""fix bug 972612 - is_gc_count should be per-ADU | ||
Revision ID: c1ac31c8fea | ||
Revises: 1aa9adb91413 | ||
Create Date: 2014-02-13 15:14:23.916163 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'c1ac31c8fea' | ||
down_revision = '491cdcf9f97c' | ||
|
||
import datetime | ||
|
||
from alembic import op | ||
from socorro.lib import citexttype, jsontype, buildtype | ||
from socorro.lib.migrations import fix_permissions, load_stored_proc | ||
|
||
import sqlalchemy as sa | ||
from sqlalchemy import types | ||
from sqlalchemy.dialects import postgresql | ||
from sqlalchemy.sql import table, column | ||
|
||
|
||
|
||
|
||
def upgrade(): | ||
load_stored_proc(op, ['update_gccrashes.sql']) | ||
op.execute(""" TRUNCATE gccrashes """) | ||
op.alter_column(u'gccrashes', sa.Column(u'version_string', sa.REAL())) | ||
now = datetime.datetime.utcnow() | ||
for backfill_date in [ | ||
(now - datetime.timedelta(days=days)).strftime("%Y-%m-%d") | ||
for days in range(1,30)]: | ||
op.execute(""" SELECT backfill_gccrashes('%s') """ % backfill_date) | ||
op.execute(""" COMMIT """) | ||
|
||
|
||
|
||
def downgrade(): | ||
load_stored_proc(op, ['update_gccrashes.sql']) | ||
op.alter_column(u'gccrashes', sa.Column(u'version_string', sa.INT())) |
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