#666 [frontend] make clean_old_builds query join() explicit
Merged 5 years ago by praiskup. Opened 5 years ago by praiskup.
Unknown source broken-clean-old-builds  into  master

@@ -1114,7 +1114,7 @@

                  models.CoprDir.id,

                  models.Package.id,

                  models.Package.max_builds)

-             .join(models.Build)

+             .join(models.Build, models.Build.copr_dir_id==models.CoprDir.id)

              .join(models.Package)

              .filter(models.Package.max_builds > 0)

              .group_by(

The python3-sqlalchemy-1.3.1 on Fedora 30+ is more scrict on
join()s, and it better detected our over-linkage between
CoprDir--Build--Package tables (the broken schema problem is
tracked as tracked as issue #617).

Detected by testsuite on F30:
E sqlalchemy.exc.InvalidRequestError: Can't determine which FROM
clause to join from, there are multiple FROMS which can join to
this entity. Try adding an explicit ON clause to help resolve the
ambiguity.

rebased onto 5e3870b

5 years ago

Pull-Request has been merged by praiskup

5 years ago
Metadata