mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Updated the Provider stats and rates DAO objects to query based on the identifier in the ProviderDetails object.
- updated all tests - changed teardown to leave provider details rows on end of individual tests
This commit is contained in:
@@ -15,7 +15,6 @@ import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('provider_rates',
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('valid_from', sa.DateTime(), nullable=False),
|
||||
@@ -33,12 +32,9 @@ def upgrade():
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_provider_statistics_service_id'), 'provider_statistics', ['service_id'], unique=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_provider_statistics_service_id'), table_name='provider_statistics')
|
||||
op.drop_table('provider_statistics')
|
||||
op.drop_table('provider_rates')
|
||||
### end Alembic commands ###
|
||||
|
||||
@@ -62,7 +62,6 @@ def upgrade():
|
||||
"UPDATE provider_statistics set provider_id = (select id from provider_details where identifier = 'ses') where provider = 'ses'"
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
op.drop_constraint(None, 'provider_statistics', type_='foreignkey')
|
||||
@@ -73,4 +72,3 @@ def downgrade():
|
||||
op.drop_column('provider_rates', 'provider_id')
|
||||
|
||||
op.drop_table('provider_details')
|
||||
### end Alembic commands ###
|
||||
|
||||
@@ -26,7 +26,6 @@ def upgrade():
|
||||
op.drop_column('provider_statistics', 'provider')
|
||||
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
op.add_column('provider_statistics', sa.Column('provider', postgresql.ENUM('mmg', 'twilio', 'firetext', 'ses', name='providers'), autoincrement=False, nullable=False))
|
||||
@@ -37,4 +36,3 @@ def downgrade():
|
||||
op.alter_column('provider_rates', 'provider_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user