discard adjustable models' id prefix & payload length
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
from typing import TYPE_CHECKING
|
||||
from sqlalchemy import Column, DateTime, String, ForeignKey, BigInteger
|
||||
from sqlalchemy.sql import func
|
||||
from .base import AutoID, Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .user import User
|
||||
from .workspace import Workspace
|
||||
|
||||
class LibraryItem(Base, AutoID):
|
||||
"""工作区共享媒体/文件资源库"""
|
||||
__tablename__ = "library_items"
|
||||
|
||||
workspace_id = Column(
|
||||
String(Workspace.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("workspaces.id", ondelete="CASCADE"),
|
||||
index=True,
|
||||
)
|
||||
@@ -34,7 +29,7 @@ class LibraryItem(Base, AutoID):
|
||||
mime_type = Column(String, nullable=True) # 媒体类型,例如 'image/jpeg', 'video/mp4', 'application/pdf'
|
||||
|
||||
uploaded_by = Column(
|
||||
String(User.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("users.id", ondelete="SET NULL"),
|
||||
nullable=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user