mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
reformat
This commit is contained in:
@@ -9,26 +9,47 @@ from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0192_drop_provider_statistics'
|
||||
down_revision = '0191_ft_billing_pkey'
|
||||
revision = "0192_drop_provider_statistics"
|
||||
down_revision = "0191_ft_billing_pkey"
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.drop_index('ix_provider_statistics_provider_id', table_name='provider_statistics')
|
||||
op.drop_index('ix_provider_statistics_service_id', table_name='provider_statistics')
|
||||
op.drop_table('provider_statistics')
|
||||
op.drop_index(
|
||||
"ix_provider_statistics_provider_id", table_name="provider_statistics"
|
||||
)
|
||||
op.drop_index("ix_provider_statistics_service_id", table_name="provider_statistics")
|
||||
op.drop_table("provider_statistics")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.create_table('provider_statistics',
|
||||
sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('day', sa.DATE(), autoincrement=False, nullable=False),
|
||||
sa.Column('service_id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column('unit_count', sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column('provider_id', postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.ForeignKeyConstraint(['provider_id'], ['provider_details.id'], name='provider_stats_to_provider_fk'),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], name='provider_statistics_service_id_fkey'),
|
||||
sa.PrimaryKeyConstraint('id', name='provider_statistics_pkey')
|
||||
op.create_table(
|
||||
"provider_statistics",
|
||||
sa.Column("id", postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column("day", sa.DATE(), autoincrement=False, nullable=False),
|
||||
sa.Column("service_id", postgresql.UUID(), autoincrement=False, nullable=False),
|
||||
sa.Column("unit_count", sa.BIGINT(), autoincrement=False, nullable=False),
|
||||
sa.Column(
|
||||
"provider_id", postgresql.UUID(), autoincrement=False, nullable=False
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["provider_id"],
|
||||
["provider_details.id"],
|
||||
name="provider_stats_to_provider_fk",
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["service_id"], ["services.id"], name="provider_statistics_service_id_fkey"
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id", name="provider_statistics_pkey"),
|
||||
)
|
||||
op.create_index(
|
||||
"ix_provider_statistics_service_id",
|
||||
"provider_statistics",
|
||||
["service_id"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_provider_statistics_provider_id",
|
||||
"provider_statistics",
|
||||
["provider_id"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index('ix_provider_statistics_service_id', 'provider_statistics', ['service_id'], unique=False)
|
||||
op.create_index('ix_provider_statistics_provider_id', 'provider_statistics', ['provider_id'], unique=False)
|
||||
|
||||
Reference in New Issue
Block a user