"""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")

[((1575, 1606), 'alembic.op.drop_table', 'op.drop_table', (['"""job_statistics"""'], {}), "('job_statistics')\n", (1588, 1606), False, 'from alembic import op\n'), ((1244, 1292), 'sqlalchemy.ForeignKeyConstraint', 'sa.ForeignKeyConstraint', (["['job_id']", "['jobs.id']"], {}), "(['job_id'], ['jobs.id'])\n", (1267, 1292), True, 'import sqlalchemy as sa\n'), ((1337, 1366), 'sqlalchemy.PrimaryKeyConstraint', 'sa.PrimaryKeyConstraint', (['"""id"""'], {}), "('id')\n", (1360, 1366), True, 'import sqlalchemy as sa\n'), ((1394, 1426), 'alembic.op.f', 'op.f', (['"""ix_job_statistics_job_id"""'], {}), "('ix_job_statistics_job_id')\n", (1398, 1426), False, 'from alembic import op\n'), ((1508, 1540), 'alembic.op.f', 'op.f', (['"""ix_job_statistics_job_id"""'], {}), "('ix_job_statistics_job_id')\n", (1512, 1540), False, 'from alembic import op\n'), ((441, 470), 'sqlalchemy.dialects.postgresql.UUID', 'postgresql.UUID', ([], {'as_uuid': '(True)'}), '(as_uuid=True)\n', (456, 470), False, 'from sqlalchemy.dialects import postgresql\n'), ((517, 546), 'sqlalchemy.dialects.postgresql.UUID', 'postgresql.UUID', ([], {'as_uuid': '(True)'}), '(as_uuid=True)\n', (532, 546), False, 'from sqlalchemy.dialects import postgresql\n'), ((598, 613), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (611, 613), True, 'import sqlalchemy as sa\n'), ((670, 685), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (683, 685), True, 'import sqlalchemy as sa\n'), ((739, 754), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (752, 754), True, 'import sqlalchemy as sa\n'), ((803, 818), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (816, 818), True, 'import sqlalchemy as sa\n'), ((872, 887), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (885, 887), True, 'import sqlalchemy as sa\n'), ((938, 953), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (951, 953), True, 'import sqlalchemy as sa\n'), ((1006, 1021), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (1019, 1021), True, 'import sqlalchemy as sa\n'), ((1076, 1091), 'sqlalchemy.BigInteger', 'sa.BigInteger', ([], {}), '()\n', (1089, 1091), True, 'import sqlalchemy as sa\n'), ((1142, 1155), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1153, 1155), True, 'import sqlalchemy as sa\n'), ((1205, 1218), 'sqlalchemy.DateTime', 'sa.DateTime', ([], {}), '()\n', (1216, 1218), True, 'import sqlalchemy as sa\n')]