mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Build rest endpoint to read service stats
- get stats by service id - returns a list of stats objects Not paginated - have 1 row per day.
This commit is contained in:
@@ -15,8 +15,7 @@ import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('service_notification_stats',
|
||||
op.create_table('notification_statistics',
|
||||
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),
|
||||
@@ -30,12 +29,9 @@ def upgrade():
|
||||
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 ###
|
||||
op.create_index(op.f('ix_service_notification_stats_service_id'), 'notification_statistics', ['service_id'], unique=False)
|
||||
|
||||
|
||||
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 ###
|
||||
op.drop_index(op.f('ix_service_notification_stats_service_id'), table_name='notification_statistics')
|
||||
op.drop_table('notification_statistics')
|
||||
|
||||
Reference in New Issue
Block a user