"""empty message

Revision ID: 48caa18ec428
Revises: 2a48241e9f91
Create Date: 2022-06-25 17:57:46.862091

"""
import datetime

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

# revision identifiers, used by Alembic.
revision = '48caa18ec428'
down_revision = '2a48241e9f91'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('channel', 'last_post_sent')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('channel', sa.Column('last_post_sent', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))

    last_post_sent = sa.table('channel', sa.column('last_post_sent'))
    op.execute(last_post_sent.update().values(last_post_sent=datetime.datetime.utcnow()))
    op.alter_column('channel', 'last_post_sent', nullable=False)
    # ### end Alembic commands ###
