Skip to content

Commit

Permalink
more models tinkering
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielBusta committed May 28, 2024
1 parent d1af4b7 commit 39703ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/src/shipit_api/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class Approval(db.Model):
completed_by = sa.Column(sa.String)
signed = sa.Column(sa.Boolean, default=False)
step_id = sa.Column(sa.Integer, sa.ForeignKey("shipit_api_workflow_steps.id"))
step = sqlalchemy.orm.relationship("Step", back_populates="steps")
step = sqlalchemy.orm.relationship("Step", back_populates="approvals")

def __init__(self, uid, name, description, permissions):
self.uid = uid
Expand Down Expand Up @@ -312,7 +312,7 @@ class Step(db.Model):
completed_by = sa.Column(sa.String)
workflow_id = sa.Column(sa.Integer, sa.ForeignKey("shipit_api_workflows.id"))
workflow = sqlalchemy.orm.relationship("Workflow", back_populates="steps")
approvals = sqlalchemy.orm.relationship("Approval", order_by=Approval.id, back_populates="approvals")
approvals = sqlalchemy.orm.relationship("Approval", order_by=Approval.id, back_populates="step")


class Workflow(db.Model):
Expand Down

0 comments on commit 39703ef

Please sign in to comment.