"""empty message

Revision ID: 0084_add_job_stats
Revises: 0083_add_perm_types_and_svc_perm
Create Date: 2017-05-12 13:16:14.147368

"""

# revision identifiers, used by Alembic.
revision = "0084_add_job_stats"
down_revision = "0083_add_perm_types_and_svc_perm"

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql


def upgrade():
    op.create_table(
        "job_statistics",
        sa.Column("id", postgresql.UUID(as_uuid=True), nullable=False),
        sa.Column("job_id", postgresql.UUID(as_uuid=True), nullable=False),
        sa.Column("emails_sent", sa.BigInteger(), nullable=False),
        sa.Column("emails_delivered", sa.BigInteger(), nullable=False),
        sa.Column("emails_failed", sa.BigInteger(), nullable=False),
        sa.Column("sms_sent", sa.BigInteger(), nullable=False),
        sa.Column("sms_delivered", sa.BigInteger(), nullable=False),
        sa.Column("sms_failed", sa.BigInteger(), nullable=False),
        sa.Column("letters_sent", sa.BigInteger(), nullable=False),
        sa.Column("letters_failed", sa.BigInteger(), nullable=False),
        sa.Column("created_at", sa.DateTime(), nullable=True),
        sa.Column("updated_at", sa.DateTime(), nullable=True),
        sa.ForeignKeyConstraint(
            ["job_id"],
            ["jobs.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_job_statistics_job_id"), "job_statistics", ["job_id"], unique=True)


def downgrade():
    op.drop_index(op.f("ix_job_statistics_job_id"), table_name="job_statistics")
    op.drop_table("job_statistics")

[(44, 'alembic.op.drop_table', 'op.drop_table', (['"""job_statistics"""'], {}), False, 'from alembic import op\n'), (33, 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['job_id']", "['jobs.id']"], {}), True, 'import sqlalchemy as sa\n'), (37, 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), True, 'import sqlalchemy as sa\n'), (39, 'alembic.op.f', 'op.f', (['"""ix_job_statistics_job_id"""'], {}), False, 'from alembic import op\n'), (43, 'alembic.op.f', 'op.f', (['"""ix_job_statistics_job_id"""'], {}), False, 'from alembic import op\n'), (21, 'sqlalchemy.dialects.postgresql.UUID', 'postgresql.UUID', ([], {'as_uuid': '(True)'}), False, 'from sqlalchemy.dialects import postgresql\n'), (22, 'sqlalchemy.dialects.postgresql.UUID', 'postgresql.UUID', ([], {'as_uuid': '(True)'}), False, 'from sqlalchemy.dialects import postgresql\n'), (23, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (24, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (25, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (26, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (27, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (28, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (29, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (30, 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), True, 'import sqlalchemy as sa\n'), (31, 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), True, 'import sqlalchemy as sa\n'), (32, 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), True, 'import sqlalchemy as sa\n')]