rename project node -> project item
This commit is contained in:
@@ -2,13 +2,13 @@ from sqlalchemy import Column, DateTime, String, ForeignKey, Integer
|
||||
from sqlalchemy.sql import func
|
||||
from .base import AutoID, Base
|
||||
|
||||
class ProjectNode(Base, AutoID):
|
||||
class ProjectItem(Base, AutoID):
|
||||
"""项目与文件夹的树状虚拟文件系统"""
|
||||
__tablename__ = "project_nodes"
|
||||
__tablename__ = "project_items"
|
||||
|
||||
workspace_id = Column(String(32), ForeignKey("workspaces.id", ondelete="CASCADE"), index=True)
|
||||
# 自引用外键:如果是根目录下的顶级节点,则 parent_id 为 Null
|
||||
parent_id = Column(String(32), ForeignKey("project_nodes.id", ondelete="CASCADE"), nullable=True, index=True)
|
||||
parent_id = Column(String(32), ForeignKey("project_items.id", ondelete="CASCADE"), nullable=True, index=True)
|
||||
|
||||
name = Column(String, nullable=False)
|
||||
# 节点类型:'folder' (文件夹) 或 'project' (代表具体文件的项目实体)
|
||||
|
||||
Reference in New Issue
Block a user