Remove the archived table template_statistics. The last time the table we updated was August 30 2016, it's safe to say we are done with it.

I updated the InboundSms and TemplateRedacted model to include an index in the db.
Dropped service_permissions.updated_at column since we are not auditting the table
This commit is contained in:
Rebecca Law
2017-07-10 14:43:46 +01:00
parent 2aba819cb6
commit 8a01a76e33
6 changed files with 43 additions and 43 deletions

View File

@@ -0,0 +1,38 @@
"""empty message
Revision ID: 0106_drop_template_stats
Revises: 0105_opg_letter_org
Create Date: 2017-07-10 14:25:58.494636
"""
# revision identifiers, used by Alembic.
revision = '0106_drop_template_stats'
down_revision = '0105_opg_letter_org'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
op.drop_table('template_statistics')
op.drop_column('service_permissions', 'updated_at')
def downgrade():
op.add_column('service_permissions',
sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
op.create_table('template_statistics',
sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column('service_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column('template_id', postgresql.UUID(), autoincrement=False, nullable=False),
sa.Column('usage_count', sa.BIGINT(), autoincrement=False, nullable=False),
sa.Column('day', sa.DATE(), autoincrement=False, nullable=False),
sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['service_id'], ['services.id'],
name='template_statistics_service_id_fkey'),
sa.ForeignKeyConstraint(['template_id'], ['templates.id'],
name='template_statistics_template_id_fkey'),
sa.PrimaryKeyConstraint('id', name='template_statistics_pkey')
)