Skip to content

Commit

Permalink
frontend: add relationship between actions and projects/builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nikromen committed Jul 18, 2023
1 parent 46ae367 commit 7abbf61
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/coprs_frontend/coprs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ class _CoprPublic(db.Model, helpers.Serializer):
group_id = db.Column(db.Integer, db.ForeignKey("group.id"))
forked_from_id = db.Column(db.Integer, db.ForeignKey("copr.id"))

actions = db.relationship(back_populates="copr")

# enable networking for the builds by default
build_enable_net = db.Column(db.Boolean, default=True,
server_default="1", nullable=False)
Expand Down Expand Up @@ -2139,6 +2141,9 @@ class Action(db.Model, helpers.Serializer):
# time ended as returned by int(time.time())
ended_on = db.Column(db.Integer, index=True)

copr_id = db.Column(db.Integer, db.ForeignKey("copr.id"))
copr = db.relationship(back_populates="actions")

def __str__(self):
return self.__unicode__()

Expand Down

0 comments on commit 7abbf61

Please sign in to comment.