severity = Column(Text)
+ # Commit ID
+
+ commit_id = Column(Integer, ForeignKey("source_commits.id"))
+
# Commit
- @lazy_property
- def commit(self):
- if self.pkg and self.pkg.commit:
- return self.pkg.commit
+ commit = sqlalchemy.orm.relationship(
+ "SourceCommit", foreign_keys=[commit_id], lazy="selectin",
+ )
def has_perm(self, user):
"""
test_group_id integer,
test boolean DEFAULT false NOT NULL,
disable_test_builds boolean DEFAULT false NOT NULL,
- points integer DEFAULT 0 NOT NULL
+ points integer DEFAULT 0 NOT NULL,
+ commit_id integer
);
ADD CONSTRAINT builds_comments_user_id FOREIGN KEY (user_id) REFERENCES public.users(id);
+--
+-- Name: builds builds_commit_id; Type: FK CONSTRAINT; Schema: public; Owner: -
+--
+
+ALTER TABLE ONLY public.builds
+ ADD CONSTRAINT builds_commit_id FOREIGN KEY (commit_id) REFERENCES public.source_commits(id) NOT VALID;
+
+
--
-- Name: builds builds_deleted_by; Type: FK CONSTRAINT; Schema: public; Owner: -
--