discard adjustable models' id prefix & payload length
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
from typing import TYPE_CHECKING
|
||||
from sqlalchemy import Column, DateTime, String, ForeignKey, BigInteger, UniqueConstraint, Integer
|
||||
from sqlalchemy.sql import func
|
||||
from .base import AutoID, Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .user import User
|
||||
|
||||
class Workspace(Base, AutoID):
|
||||
"""工作区表"""
|
||||
__tablename__ = "workspaces"
|
||||
@@ -34,13 +30,13 @@ class WorkspaceMember(Base, AutoID):
|
||||
__tablename__ = "workspace_members"
|
||||
|
||||
workspace_id = Column(
|
||||
String(Workspace.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("workspaces.id", ondelete="CASCADE"),
|
||||
index=True,
|
||||
)
|
||||
# 允许 user_id 为空,因为被邀请的人可能还没注册系统,我们先记录他的邮箱
|
||||
user_id = Column(
|
||||
String(User.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("users.id", ondelete="CASCADE"),
|
||||
nullable=True,
|
||||
index=True,
|
||||
|
||||
Reference in New Issue
Block a user