"""Edge Database table."""
from sqlalchemy import Column, Integer, JSON
from jobmon.server.web.models import Base
[docs]
class Edge(Base):
"""Database Table to record edges."""
[docs]
dag_id = Column(Integer, primary_key=True)
[docs]
node_id = Column(Integer, primary_key=True)
# Upstream and downstream nodes are edge lists (incoming and outgoing).
# They are python lists serialized as strings
# with syntax: "[node_id, node_id, node_id, ...]"
# for implementation details refer to
# jobmon/client/swarm/workflow/clientdag.py
# method: _insert_edges()
[docs]
upstream_node_ids = Column(JSON)
[docs]
downstream_node_ids = Column(JSON)