"""update task tbl: new last_message_datetime

Revision ID: eea96681de05
Revises: <KEY>
Create Date: 2022-01-17 11:16:36.273669

"""
import sqlalchemy as sa
from sqlalchemy import func

from alembic import context, op

# revision identifiers, used by Alembic.
revision = "eea96681de05"
down_revision = "<KEY>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    if context.get_x_argument(as_dictionary=True).get("sqlite", None):
        op.add_column(
            "task",
            sa.Column(
                "last_message_datetime",
                sa.DateTime(),
                server_default="NOW()",
                nullable=False,
            ),
        )
    else:
        op.add_column(
            "task",
            sa.Column(
                "last_message_datetime",
                sa.DateTime(),
                server_default=func.now(),
                nullable=False,
            ),
        )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("task", "last_message_datetime")
    # ### end Alembic commands ###

"""update task tbl: new last_message_datetime

Revision ID: eea96681de05
Revises: <KEY>
Create Date: 2022-01-17 11:16:36.273669

"""
import sqlalchemy as sa
from sqlalchemy import func

from alembic import context, op

# revision identifiers, used by Alembic.
revision = "eea96681de05"
down_revision = "<KEY>"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    if context.get_x_argument(as_dictionary=True).get("sqlite", None):
        op.add_column(
            "task",
            sa.Column(
                "last_message_datetime",
                sa.DateTime(),
                server_default="NOW()",
                nullable=False,
            ),
        )
    else:
        op.add_column(
            "task",
            sa.Column(
                "last_message_datetime",
                sa.DateTime(),
                server_default=func.now(),
                nullable=False,
            ),
        )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("task", "last_message_datetime")
    # ### end Alembic commands ###

update task tbl: new last_message_datetime  Revision ID: eea96681de05 Revises: <KEY> Create Date: 2022-01-17 11:16:36.273669 # 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 ###