| |
@@ -444,7 +444,7 @@
|
| |
session.query(ModuleBuild)
|
| |
.filter(ModuleBuild.name == name)
|
| |
.filter(ModuleBuild.state == BUILD_STATES["ready"])
|
| |
- .order_by(ModuleBuild.version.desc())
|
| |
+ .order_by(ModuleBuild.id.desc())
|
| |
)
|
| |
|
| |
query = ModuleBuild._add_stream_version_lte_filter(session, query, stream_version)
|
| |
@@ -453,8 +453,8 @@
|
| |
builds = query.all()
|
| |
|
| |
# In case there are multiple versions of single name:stream build, we want to return
|
| |
- # the latest version only. The `builds` are ordered by "version" desc, so we
|
| |
- # can just get the first (greatest) version of name:stream.
|
| |
+ # the latest version only. The `builds` are ordered by "id" desc, so we
|
| |
+ # can just get the first (greatest) id and therefore version of name:stream.
|
| |
# TODO: Is there a way how to do that nicely in the SQL query itself?
|
| |
seen = {} # {"n:s": v, ...}
|
| |
ret = []
|
| |
This fixes following error:
ProgrammingError: (ProgrammingError) SELECT DISTINCT ON expressions must match initial ORDER BY expressions