candlepin/candlepin — pull request #207 by jmrodri (2013-03-27 21:39:20+00:00)
Title: Upgrade the database preparing for identity cert export

This branch contains all of the changes from PR https://github.com/candlepin/candlepin/pull/116 plus the database upgrade bits which @dgoodwin pointed out in his previous review.

TEST
-------
1. checkout and DEPLOY master
2. import a manifest
* ./cpc import admin /tmp/og-cfse-906553.zip
3. inspect database
* psql -U candlepin
* # \d cp_import_record (observe it has upstream_name, upstream_type)
* # \d cp_owner (observe it has upstream_uuid column)
* select * from cp_import_record; (observe there is data in table)

4. checkout idcertupgrade branch
* git checkout idcertupgrade
5.Upgrade the database using liquibase
```liquibase --driver=org.postgresql.Driver --classpath=src/main/resources/:target/classes/:/usr/share/java/postgresql-jdbc.jar --changeLogFile=db/changelog/changelog-update.xml --url=jdbc:postgresql:candlepin --username=candlepin --logLevel=debug update -Dcommunity=True```
6. re-inspect database
* cp_import_record should only have 1 upstream_id column, the other upstream* columns should be gone
* cp_owner should now have an upstream_id column
* there should be a new cp_upstream_consumer table
* select * from cp_upstream_consumer, verify that the data is correct and links to the proper owner and cp_import_record.

PREVIOUS TEST
---------------------------
Also retest the previous pull request features to ensure things still work as expected. To see those instructions visit PR https://github.com/candlepin/candlepin/pull/116