fix: 修两个 bug

1. ArticleRead.user_id 改 Integer(users.id 是 Integer,不是 BigInteger)
   alembic 0007 同样改 Integer
2. ArticleDetail.vue toggleRead 重复 catch 块导致 build 失败
   (edit 时新加的 catch 跟 toggleStar 残留的 catch 撞了)
This commit is contained in:
xiaji
2026-06-13 21:10:22 +08:00
parent 6c71ab2e79
commit 4ca05b8b7d
3 changed files with 5 additions and 7 deletions

View File

@@ -25,8 +25,8 @@ depends_on = None
def upgrade() -> None:
op.create_table(
"article_reads",
sa.Column("user_id", sa.BigInteger, nullable=False),
sa.Column("article_id", sa.BigInteger, nullable=False),
sa.Column("user_id", sa.Integer, nullable=False), # users.id 是 Integer
sa.Column("article_id", sa.BigInteger, nullable=False), # articles.id 是 BigInteger
sa.Column("read_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.text("now()")),
sa.PrimaryKeyConstraint("user_id", "article_id", name="pk_article_reads"),
sa.ForeignKeyConstraint(