"""20251126213637 Revision ID: fbab88219447 Revises: f210d1844b07 Create Date: 2025-11-26 21:36:45.872344 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'fbab88219447' down_revision: Union[str, None] = 'f210d1844b07' 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! ### # 检查列是否存在再进行操作 op.execute(""" DO $$ BEGIN IF EXISTS (SELECT FROM information_schema.columns WHERE table_name = 'data_config' AND column_name = 'workspace_id') THEN COMMENT ON COLUMN data_config.workspace_id IS '工作空间ID'; END IF; END $$; """) # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### # 检查列是否存在再进行操作 op.execute(""" DO $$ BEGIN IF EXISTS (SELECT FROM information_schema.columns WHERE table_name = 'data_config' AND column_name = 'workspace_id') THEN COMMENT ON COLUMN data_config.workspace_id IS 'comment'; END IF; END $$; """) # ### end Alembic commands ###