# pylint: disable=invalid-name
"""Activity log

Revision ID: 8ab39ac619ed
Revises: d0fc64ab8b98
Create Date: 2021-05-18 22:14:52.639270+00:00

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "8ab39ac619ed"
down_revision = "d0fc64ab8b98"
branch_labels = None
depends_on = None


def upgrade():
    op.create_table(
        "activity_log_record",
        sa.Column("id", sa.String(length=200), nullable=False),
        sa.Column("timestamp", sa.DateTime(), nullable=False),
        sa.Column("organization_id", sa.String(length=200), nullable=False),
        sa.Column("activity_name", sa.String(length=200), nullable=False),
        sa.Column("info", sa.JSON(), nullable=False),
        sa.Column("posted_to_slack_at", sa.DateTime(), nullable=True),
        sa.ForeignKeyConstraint(
            ["organization_id"],
            ["organization.id"],
            name=op.f("activity_log_record_organization_id_fkey"),
            ondelete="cascade",
        ),
        sa.PrimaryKeyConstraint("id", name=op.f("activity_log_record_pkey")),
    )


def downgrade():  # pragma: no cover
    pass
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_table("activity_log_record")
    # ### end Alembic commands ###
