From 840b2a77601dfe9cc9a083411ffb6c625efc1753 Mon Sep 17 00:00:00 2001 From: xingc Date: Thu, 24 Apr 2025 17:36:58 +0800 Subject: [PATCH] =?UTF-8?q?feat(db):=20=E5=A4=B4=E5=83=8F=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=AF=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alembic/versions/b2d35cbc76bd_init.py | 2 +- core/db/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alembic/versions/b2d35cbc76bd_init.py b/alembic/versions/b2d35cbc76bd_init.py index 5d81b98..6a91918 100644 --- a/alembic/versions/b2d35cbc76bd_init.py +++ b/alembic/versions/b2d35cbc76bd_init.py @@ -58,7 +58,7 @@ def upgrade() -> None: sa.Column('user_id', sa.Integer(), autoincrement=True, nullable=False, comment='用户id'), sa.Column('nickname', sa.String(length=20), nullable=False, comment='昵称'), sa.Column('gender', sa.Integer(), nullable=True, comment='性别'), - sa.Column('avatar_url', sa.String(length=500), nullable=False, comment='头像链接'), + sa.Column('avatar_url', sa.String(length=500), nullable=True, comment='头像链接'), sa.Column('wechat_openid', sa.String(length=100), nullable=False, comment='微信openid'), sa.Column('wechat_union_id', sa.String(length=100), nullable=True, comment='微信unionid'), sa.Column('phone', sa.String(length=11), nullable=True, comment='手机号码'), diff --git a/core/db/models.py b/core/db/models.py index 9ac937c..bd96d47 100644 --- a/core/db/models.py +++ b/core/db/models.py @@ -69,7 +69,7 @@ class User(BaseModel, DateModel): ) nickname: Mapped[str] = mapped_column(String(20), comment='昵称') gender: Mapped[int] = mapped_column(Integer, nullable=True, comment='性别') - avatar_url: Mapped[str] = mapped_column(String(500), comment='头像链接') + avatar_url: Mapped[str] = mapped_column(String(500), nullable=True, comment='头像链接') wechat_openid: Mapped[str] = mapped_column(String(100), comment='微信openid') wechat_union_id: Mapped[str] = mapped_column(String(100), nullable=True, comment='微信unionid') phone: Mapped[str] = mapped_column(String(11), nullable=True, comment='手机号码')