mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Refactor the sms sender code to remove any unused methods.
Refactor tests/db/create_service() to behave more like the real world. Created new create_service_with_inbound_number and create_service_with_defined_sms_sender() test/db methods.
This commit is contained in:
51
migrations/versions/0133_sms_sender_nullable.py
Normal file
51
migrations/versions/0133_sms_sender_nullable.py
Normal file
@@ -0,0 +1,51 @@
|
||||
"""
|
||||
|
||||
Revision ID: 2054e740350f
|
||||
Revises: 0132_add_sms_prefix_setting
|
||||
Create Date: 2017-11-06 15:44:59.471977
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0133_sms_sender_nullable'
|
||||
down_revision = '0132_add_sms_prefix_setting'
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('notification_statistics')
|
||||
op.alter_column('services', 'sms_sender',
|
||||
existing_type=sa.VARCHAR(length=11),
|
||||
nullable=True)
|
||||
op.alter_column('services_history', 'sms_sender',
|
||||
existing_type=sa.VARCHAR(length=11),
|
||||
nullable=True)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('services_history', 'sms_sender',
|
||||
existing_type=sa.VARCHAR(length=11),
|
||||
nullable=False)
|
||||
op.alter_column('services', 'sms_sender',
|
||||
existing_type=sa.VARCHAR(length=11),
|
||||
nullable=False)
|
||||
op.create_table('notification_statistics',
|
||||
sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('service_id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('emails_requested', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('emails_delivered', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('emails_failed', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('sms_requested', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('sms_delivered', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('sms_failed', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('day', sa.DATE(), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'],
|
||||
name='notification_statistics_service_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='notification_statistics_pkey'),
|
||||
sa.UniqueConstraint('service_id', 'day', name='uix_service_to_day')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user