"""empty message

Revision ID: 3a0072e54c00
Revises: 81c062027a76
Create Date: 2022-04-07 14:10:35.224806

"""
import datetime

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3a0072e54c00'
down_revision = '81c062027a76'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('analytics',
    sa.Column('date', sa.DateTime(), nullable=False),
    sa.Column('register_count', sa.Integer(), nullable=False),
    sa.Column('active_user_count', sa.Integer(), nullable=False),
    sa.Column('post_count', sa.Integer(), nullable=False),
    sa.Column('likes_count', sa.Integer(), nullable=False),
    sa.Column('dislikes_count', sa.Integer(), nullable=False),
    sa.Column('matches_count', sa.Integer(), nullable=False),
    sa.Column('projects_count', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('date')
    )
    op.add_column('user', sa.Column('last_active', sa.DateTime(), nullable=True))
    last_active = sa.table('user', sa.column('last_active'))
    op.execute(last_active.update().values(last_active=datetime.datetime.min))
    op.alter_column('user', 'last_active', nullable=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('user', 'last_active')
    op.drop_table('analytics')
    # ### end Alembic commands ###
