mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 06:52:06 -05:00
New notification stats table
- to capture the counts of things that we do - initial commit captures when we create an email or sms DOES NOT know about ultimate success only that we asked our partners to ship the notification Requires some updates when we retry sending in event of error.
This commit is contained in:
41
migrations/versions/0036_notification_stats.py
Normal file
41
migrations/versions/0036_notification_stats.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0036_notification_stats
|
||||
Revises: 0035_default_sent_count
|
||||
Create Date: 2016-03-08 11:16:25.659463
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0036_notification_stats'
|
||||
down_revision = '0035_default_sent_count'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('service_notification_stats',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('day', sa.String(length=255), nullable=False),
|
||||
sa.Column('service_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('emails_requested', sa.BigInteger(), nullable=False),
|
||||
sa.Column('emails_delivered', sa.BigInteger(), nullable=True),
|
||||
sa.Column('emails_error', sa.BigInteger(), nullable=True),
|
||||
sa.Column('sms_requested', sa.BigInteger(), nullable=False),
|
||||
sa.Column('sms_delivered', sa.BigInteger(), nullable=True),
|
||||
sa.Column('sms_error', sa.BigInteger(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('service_id', 'day', name='uix_service_to_day')
|
||||
)
|
||||
op.create_index(op.f('ix_service_notification_stats_service_id'), 'service_notification_stats', ['service_id'], unique=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_service_notification_stats_service_id'), table_name='service_notification_stats')
|
||||
op.drop_table('service_notification_stats')
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user