"""add app_mode for messsage

Revision ID: d98acf217d43
Revises: 68519ad5cd18
Create Date: 2025-10-14 16:18:08.568011

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

# revision identifiers, used by Alembic.
revision = 'd98acf217d43'
down_revision = '68519ad5cd18'
branch_labels = None
depends_on = None


def upgrade():
    with op.batch_alter_table('messages', schema=None) as batch_op:
        batch_op.add_column(sa.Column('app_mode', sa.String(length=255), nullable=True))
        batch_op.create_index('message_app_mode_idx', ['app_mode'], unique=False)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###

    with op.batch_alter_table('messages', schema=None) as batch_op:
        batch_op.drop_index('message_app_mode_idx')
        batch_op.drop_column('app_mode')

    # ### end Alembic commands ###
