<reponame>jordanc-afk/personal-wolfit
"""Add activity log

Revision ID: 299114eddda7
Revises: <PASSWORD>
Create Date: 2018-08-31 11:36:12.353037

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "299114eddda7"
down_revision = "<PASSWORD>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "activity_log",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("timestamp", sa.DateTime(), nullable=True),
        sa.Column("user_id", sa.Integer(), nullable=True),
        sa.Column("details", sa.Text(), nullable=True),
        sa.ForeignKeyConstraint(["user_id"], ["user.id"]),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(
        op.f("ix_activity_log_timestamp"), "activity_log", ["timestamp"], unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_activity_log_timestamp"), table_name="activity_log")
    op.drop_table("activity_log")
    # ### end Alembic commands ###

"""Add activity log

Revision ID: 299114eddda7
Revises: <PASSWORD>
Create Date: 2018-08-31 11:36:12.353037

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "299114eddda7"
down_revision = "<PASSWORD>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "activity_log",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("timestamp", sa.DateTime(), nullable=True),
        sa.Column("user_id", sa.Integer(), nullable=True),
        sa.Column("details", sa.Text(), nullable=True),
        sa.ForeignKeyConstraint(["user_id"], ["user.id"]),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(
        op.f("ix_activity_log_timestamp"), "activity_log", ["timestamp"], unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_activity_log_timestamp"), table_name="activity_log")
    op.drop_table("activity_log")
    # ### end Alembic commands ###
Add activity log  Revision ID: 299114eddda7 Revises: <PASSWORD> Create Date: 2018-08-31 11:36:12.353037 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###