discard adjustable models' id prefix & payload length
This commit is contained in:
@@ -1,24 +1,18 @@
|
||||
from typing import TYPE_CHECKING
|
||||
from sqlalchemy import Column, DateTime, String, ForeignKey, UniqueConstraint
|
||||
from sqlalchemy.sql import func
|
||||
from .base import AutoID, Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .user import User
|
||||
from .project import ProjectItem
|
||||
from .workspace import Workspace
|
||||
|
||||
class ProjectLike(Base, AutoID):
|
||||
"""项目点赞表"""
|
||||
__tablename__ = "project_likes"
|
||||
|
||||
user_id = Column(
|
||||
String(User.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("users.id", ondelete="CASCADE"),
|
||||
index=True
|
||||
)
|
||||
project_item_id = Column(
|
||||
String(ProjectItem.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("project_items.id", ondelete="CASCADE"),
|
||||
index=True
|
||||
)
|
||||
@@ -34,12 +28,12 @@ class ProjectFavorite(Base, AutoID):
|
||||
__tablename__ = "project_favorites"
|
||||
|
||||
user_id = Column(
|
||||
String(User.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("users.id", ondelete="CASCADE"),
|
||||
index=True
|
||||
)
|
||||
project_item_id = Column(
|
||||
String(ProjectItem.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("project_items.id", ondelete="CASCADE"),
|
||||
index=True
|
||||
)
|
||||
@@ -55,12 +49,12 @@ class ProjectShare(Base, AutoID):
|
||||
__tablename__ = "project_shares"
|
||||
|
||||
user_id = Column(
|
||||
String(User.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("users.id", ondelete="CASCADE"),
|
||||
index=True
|
||||
)
|
||||
project_item_id = Column(
|
||||
String(ProjectItem.id_length()),
|
||||
String(AutoID.id_length()),
|
||||
ForeignKey("project_items.id", ondelete="CASCADE"),
|
||||
index=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user