feat(api): Allow the `node_execution_id` field to be `NULL`.

pull/20746/head
QuantumGhost 12 months ago
parent 9b3cf5fb10
commit dea67a85a9

@ -34,7 +34,7 @@ def upgrade():
) )
with op.batch_alter_table('workflow_draft_variables', schema=None) as batch_op: with op.batch_alter_table('workflow_draft_variables', schema=None) as batch_op:
batch_op.add_column(sa.Column('node_execution_id', models.types.StringUUID(), nullable=False)) batch_op.add_column(sa.Column('node_execution_id', models.types.StringUUID(), nullable=True))
# ### end Alembic commands ### # ### end Alembic commands ###

@ -919,7 +919,14 @@ class WorkflowDraftVariable(Base):
# The `node_execution_id` field identifies the workflow node execution that created this variable. # The `node_execution_id` field identifies the workflow node execution that created this variable.
# It corresponds to the `id` field in the `WorkflowNodeExecutionModel` model. # It corresponds to the `id` field in the `WorkflowNodeExecutionModel` model.
node_execution_id: Mapped[str] = mapped_column(StringUUID, nullable=False) #
# This field is not `None` for system variables and node variables, and is `None`
# for conversation variables.
node_execution_id: Mapped[str | None] = mapped_column(
StringUUID,
nullable=True,
default=None,
)
def get_selector(self) -> list[str]: def get_selector(self) -> list[str]:
selector = json.loads(self.selector) selector = json.loads(self.selector)

Loading…
Cancel
Save