"""Removing Parent Catalog ID from Catalog ==> use tags in user_metadata instead

Revision ID: b64d5cf32c7a
Revises: 3717364e6429
Create Date: 2024-10-28 07:48:04.624298

"""
from alembic import op
import sqlalchemy as sa
import pgvector


# revision identifiers, used by Alembic.
revision = 'b64d5cf32c7a'
down_revision = '3717364e6429'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('catalog_parent_id_fkey', 'catalog', type_='foreignkey')
    op.drop_column('catalog', 'parent_id')
    op.drop_constraint('chat_session_user_id_fkey', 'chat_session', type_='foreignkey')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('catalog', sa.Column('parent_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('catalog_parent_id_fkey', 'catalog', 'catalog', ['parent_id'], ['id'])
    # ### end Alembic commands ###
