From 59c473f096bb0d412e8bd34e930dd5c37565aa84 Mon Sep 17 00:00:00 2001 From: CI Bot Date: Wed, 22 Jul 2026 22:43:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(migration):=20=E4=BF=AE=E5=A4=8Dvideo=5Fsha?= =?UTF-8?q?res=E9=87=8D=E5=A4=8D=E5=88=9B=E5=BB=BA=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=BF=81=E7=A7=BB=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit op.create_table中Column(index=True)会自动创建索引, 后面再op.create_index就重复了。按项目规范,单列索引 通过Column(index=True)声明,去掉重复的create_index。 --- alembic/versions/050_video_shares.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/alembic/versions/050_video_shares.py b/alembic/versions/050_video_shares.py index 19a262f38..0bd35d32b 100755 --- a/alembic/versions/050_video_shares.py +++ b/alembic/versions/050_video_shares.py @@ -43,13 +43,6 @@ def upgrade() -> None: sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()), ) - op.create_index("ix_video_shares_video_id", "video_shares", ["video_id"]) - op.create_index("ix_video_shares_user_id", "video_shares", ["user_id"]) - op.create_index("ix_video_shares_token", "video_shares", ["share_token"], unique=True) - def downgrade() -> None: - op.drop_index("ix_video_shares_token", table_name="video_shares") - op.drop_index("ix_video_shares_user_id", table_name="video_shares") - op.drop_index("ix_video_shares_video_id", table_name="video_shares") op.drop_table("video_shares")