Comment 0 for bug 651092

Revision history for this message
Julian Edwards (julian-edwards) wrote :

This is currently done with some SQL, like this below, but we'd much rather do it in code.

update libraryfilealias
set expires = now() - '30 days'::interval
from
   archive, binarypackagefile, binarypackagepublishinghistory, distroseries, distroarchseries
where
   archive.purpose = 1
   AND binarypackagepublishinghistory.archive = archive.id
   AND binarypackagepublishinghistory.status NOT IN (1,2)
   AND binarypackagefile.binarypackagerelease = binarypackagepublishinghistory.binarypackagerelease
   AND binarypackagefile.libraryfile = libraryfilealias.id
   AND libraryfilealias.expires is NULL
   AND distroseries.id = distroarchseries.distroseries
   AND distroarchseries.id = binarypackagepublishinghistory.distroarchseries
   AND distroseries.name = 'intrepid'
;