feat: add flow export/import backend (migration, endpoints, schemas)
Add .rfflow file export/import support:
- Migration 050: import_metadata JSONB column on trees
- GET /trees/{id}/export?format=json|xml endpoint
- POST /trees/import endpoint (creates draft, resolves categories/tags)
- FlowExportEnvelope, FlowImportRequest/Response schemas
- import_metadata field on TreeResponse
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -154,6 +154,13 @@ class Tree(Base):
|
||||
comment="Fork depth: 0 = original, 1 = direct fork, 2 = fork of fork, etc."
|
||||
)
|
||||
|
||||
# Import provenance
|
||||
import_metadata: Mapped[Optional[dict[str, Any]]] = mapped_column(
|
||||
JSONB,
|
||||
nullable=True,
|
||||
comment="Provenance metadata from .rfflow file import"
|
||||
)
|
||||
|
||||
# Relationships
|
||||
author: Mapped[Optional["User"]] = relationship("User", foreign_keys=[author_id], back_populates="trees")
|
||||
team: Mapped[Optional["Team"]] = relationship("Team", back_populates="trees")
|
||||
|
||||
Reference in New Issue
Block a user