"""ext meta with owner_group_shortname

Revision ID: 98ecd6f56f9a
Revises: 1cf4e1ee3cb8
Create Date: 2025-09-23 12:53:42.616843

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
import sqlmodel
import sqlmodel.sql.sqltypes


# revision identifiers, used by Alembic.
revision: str = '98ecd6f56f9a'
down_revision: Union[str, None] = '1cf4e1ee3cb8'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('attachments', schema=None) as batch_op:
        batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))

    with op.batch_alter_table('entries', schema=None) as batch_op:
        batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))

    with op.batch_alter_table('permissions', schema=None) as batch_op:
        batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))

    with op.batch_alter_table('roles', schema=None) as batch_op:
        batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))

    with op.batch_alter_table('spaces', schema=None) as batch_op:
        batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))

    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.add_column(sa.Column('owner_group_shortname', sqlmodel.sql.sqltypes.AutoString(), nullable=True))

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('users', schema=None) as batch_op:
        batch_op.drop_column('owner_group_shortname')

    with op.batch_alter_table('spaces', schema=None) as batch_op:
        batch_op.drop_column('owner_group_shortname')

    with op.batch_alter_table('roles', schema=None) as batch_op:
        batch_op.drop_column('owner_group_shortname')

    with op.batch_alter_table('permissions', schema=None) as batch_op:
        batch_op.drop_column('owner_group_shortname')

    with op.batch_alter_table('entries', schema=None) as batch_op:
        batch_op.drop_column('owner_group_shortname')

    with op.batch_alter_table('attachments', schema=None) as batch_op:
        batch_op.drop_column('owner_group_shortname')

    # ### end Alembic commands ###
