#10019 Cleaning packages without project reference from release-monitoring.org database
Closed: Fixed 2 years ago by kevin. Opened 2 years ago by zlopez.

Describe what you would like us to do:


I need somebody to run the following POSTGRESQL query on Anitya database in production and staging DELETE FROM packages WHERE project_id is null;. This will remove all package mappings that aren't attached to any project. I tried to run it on development database locally (imported from production backup) and it deleted 53 items.

There is already on delete cascade that should prevent this issue in future. It looks like this was just something, that was probably overlooked when the change was done.

When do you need this to be done by? (YYYY/MM/DD)


This is not urgent, but will help clean the database a little.


I found out, this is causing https://github.com/fedora-infra/anitya/issues/1081, so it would be probably better to run this sooner than later.

Done;

anitya=# select * FROM packages WHERE project_id is null;
  id   | distro_name | project_id |              package_name              
-------+-------------+------------+----------------------------------------
   187 | Fedora      |            | bind911
  2302 | Fedora      |            | nodejs-nan0
  2550 | Fedora      |            | octave-gsl
  4398 | Fedora      |            | rubygem-minitest4
  5141 | Fedora      |            | vidalia
  3845 | Fedora      |            | python-butt-sptheme
  4498 | Fedora      |            | rubygem-goocanvas1
  2263 | Fedora      |            | nodejs-inherits1
  3651 | Fedora      |            | php-phpunit-PHP-CodeBrowser
  6039 | Fedora      |            | php-phpseclib-file-asn1
  6561 | Fedora      |            | osbs
  6850 | Fedora      |            | extremetuxracer extremetuxracer-common
  6841 | Fedora      |            | petera
  7734 | Fedora      |            | openerp7
  2553 | Fedora      |            | octave-lhapdf
  2557 | Fedora      |            | octave-NLopt
  2558 | Fedora      |            | octave-octcdf
  2566 | Fedora      |            | octave-struct
  8656 | Fedora      |            | none
  8905 | Fedora      |            | lodash
  9594 | Fedora      |            | pmd-build-tools
  9553 | Fedora      |            | ardour2
  9792 | Fedora      |            | python-acoustid 
  9904 | Fedora      |            | perl-Test2
 10516 | Fedora      |            | asterisk-gui
 10483 | Fedora      |            | fleet
 10716 | PLD-Linux   |            | php-pecl-libsodium-DELETEME
 11856 | Fedora EPEL |            | libspf2
 11934 | CRUX        |            | quake2x
 13243 | Fedora      |            | test-fedimg
 14442 | Fedora      |            | nodejs-unzip-response
 14895 | Alpine      |            | __delete__py-futures
 14940 | Fedora      |            | vulkan
 14956 | Fedora      |            | python3-dateutil
 15577 | Fedora      |            | python-django-pgjsonn
 15762 | Fedora      |            | python3-zope-event
 15590 | Fedora      |            | python3-markupsafe
  7971 | Fedora      |            | pymssql
 16388 | Fedora      |            | mingw-tesseract
 16566 | Arch Linux  |            | yabuse-gtk
 16567 | Arch Linux  |            | yabuse-qt
 16191 | Fedora      |            | python-fmn
 20947 | Fedora      |            | pymetar
 21941 | Alpine      |            | perl
  2583 | Fedora      |            | libspf2
 12344 | Alpine      |            | libspf2
  8065 | Fedora      |            | cryptominisat4
 21273 | Fedora      |            | this-is-a-duplicate-please-remove
 10531 | Fedora      |            | im-chooser-xfce
  6611 | Fedora      |            | skylable-sx
  6646 | Fedora      |            | python3-iep
 15146 | Mageia      |            | iep
 16142 | Fedora      |            | eglexternalplatform
(53 rows)

anitya=# delete FROM packages WHERE project_id is null;
DELETE 53

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata