Add parent WeChat identity mapping
This commit is contained in:
@@ -245,6 +245,25 @@ class ParentWechatAccount(Base):
|
||||
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime, server_default=text("CURRENT_TIMESTAMP"))
|
||||
|
||||
|
||||
class ParentWechatIdentity(Base):
|
||||
__tablename__ = "parent_wechat_identities"
|
||||
__table_args__ = (
|
||||
UniqueConstraint("app_id", "account_type", "openid", name="uq_parent_wechat_identity_app_openid"),
|
||||
Index("idx_parent_wechat_identity_user", "user_id"),
|
||||
Index("idx_parent_wechat_identity_unionid", "unionid"),
|
||||
{'mysql_charset': 'utf8mb4', 'mysql_collate': 'utf8mb4_unicode_ci'}
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(BigInteger, ForeignKey("parents.user_id"), nullable=False)
|
||||
app_id: Mapped[str] = mapped_column(String(64), nullable=False)
|
||||
account_type: Mapped[str] = mapped_column(String(32), nullable=False)
|
||||
openid: Mapped[str] = mapped_column(String(64), nullable=False)
|
||||
unionid: Mapped[Optional[str]] = mapped_column(String(64))
|
||||
created_at: Mapped[Optional[datetime]] = mapped_column(DateTime, server_default=text("CURRENT_TIMESTAMP"))
|
||||
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime, server_default=text("CURRENT_TIMESTAMP"))
|
||||
|
||||
|
||||
class WechatMpBindState(Base):
|
||||
__tablename__ = "wechat_mp_bind_states"
|
||||
__table_args__ = (
|
||||
|
||||
Reference in New Issue
Block a user