"""add_private_attach_fields

Revision ID: e5c2c02f373c
Revises: f4a868a264cd
Create Date: 2024-08-30 11:59:12.686534

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e5c2c02f373c'
down_revision = 'f4a868a264cd'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('cmf_attachment_spectators',
    sa.Column('id', sa.String(length=128), nullable=False),
    sa.Column('parent_id', sa.String(length=64), nullable=True),
    sa.Column('root_id', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=4096), nullable=True),
    sa.Column('left_id', sa.String(length=64), nullable=True),
    sa.Column('right_id', sa.String(length=64), nullable=True),
    sa.Column('left_name_cache', sa.String(length=256), nullable=True),
    sa.Column('right_name_cache', sa.String(length=256), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_cmf_attachment_spectators_left_id'), 'cmf_attachment_spectators', ['left_id'], unique=False)
    op.create_index(op.f('ix_cmf_attachment_spectators_parent_id'), 'cmf_attachment_spectators', ['parent_id'], unique=False)
    op.create_index(op.f('ix_cmf_attachment_spectators_right_id'), 'cmf_attachment_spectators', ['right_id'], unique=False)
    op.create_index(op.f('ix_cmf_attachment_spectators_root_id'), 'cmf_attachment_spectators', ['root_id'], unique=False)
    op.add_column('cmf_attachment', sa.Column('private', sa.Boolean(), nullable=False, server_default='false'))
    op.add_column('cmf_comment', sa.Column('is_dummy', sa.Boolean(), nullable=False, server_default='false'))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('cmf_comment', 'is_dummy')
    op.drop_column('cmf_attachment', 'private')
    op.drop_index(op.f('ix_cmf_attachment_spectators_root_id'), table_name='cmf_attachment_spectators')
    op.drop_index(op.f('ix_cmf_attachment_spectators_right_id'), table_name='cmf_attachment_spectators')
    op.drop_index(op.f('ix_cmf_attachment_spectators_parent_id'), table_name='cmf_attachment_spectators')
    op.drop_index(op.f('ix_cmf_attachment_spectators_left_id'), table_name='cmf_attachment_spectators')
    op.drop_table('cmf_attachment_spectators')
    # ### end Alembic commands ###
