candlepin/candlepin — pull request #92 by dgoodwin (2012-10-16 14:28:53+00:00)
Title: Ignore old rules in database after a Candlepin upgrade.

We were correctly catching incoming old rules during manifest imports
and ignoring them in favor of those included in our rpm. We were not
handling old rules in the database after a candlepin upgrade however,
leading to major failures as we tried to use old rules that didn't work
on the new Candlepin.

Added a column in the rules table for the candlepin version the rules
originated from. This is set on import, as well as during a manual
upload (to the current version of candlepin).

When requesting the rules we check if the version in the database is
older than our current version and ignore it if so. If we see a null
candlepin version in the db, we know these must be older than the code
we're running.

Constructor updated to try to make sure we don't mistakenly store rules
without specifying that Candlepin version.