mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 09:48:25 -04:00
reformat
This commit is contained in:
@@ -9,31 +9,46 @@ from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0141_remove_unused'
|
||||
down_revision = '0140_sms_prefix_non_nullable'
|
||||
revision = "0141_remove_unused"
|
||||
down_revision = "0140_sms_prefix_non_nullable"
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.drop_table('notification_statistics')
|
||||
op.drop_column('services', 'sms_sender')
|
||||
op.drop_column('services_history', 'sms_sender')
|
||||
op.drop_table("notification_statistics")
|
||||
op.drop_column("services", "sms_sender")
|
||||
op.drop_column("services_history", "sms_sender")
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('services_history', sa.Column('sms_sender', sa.VARCHAR(length=11), autoincrement=False, nullable=True))
|
||||
op.add_column('services', sa.Column('sms_sender', sa.VARCHAR(length=11), autoincrement=False, nullable=True))
|
||||
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')
|
||||
op.add_column(
|
||||
"services_history",
|
||||
sa.Column(
|
||||
"sms_sender", sa.VARCHAR(length=11), autoincrement=False, nullable=True
|
||||
),
|
||||
)
|
||||
op.add_column(
|
||||
"services",
|
||||
sa.Column(
|
||||
"sms_sender", sa.VARCHAR(length=11), autoincrement=False, nullable=True
|
||||
),
|
||||
)
|
||||
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"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user