Appendix N validation

The objective here is that if a species is listed in any EU annex (initially I thought that was just about annex D, but it seems from Patricia's comment that it could be any), it may be reported under appendix N without raising a secondary validation error. The validation rule has been extended to allow such values.

To verify this you need to build the valid_species_name_appendix_year_mview and valid_species_name_annex_year_mview. That can be done in isolation like so (provided your cites_listing_changes_mview and eu_listing_changes_mview already there):
rake db:migrate
SELECT * FROM rebuild_valid_species_name_appendix_year_mview()
SELECT * FROM rebuild_valid_species_name_annex_year_mview()

UPDATE:
The mviews are now structured differently. Previously we would have one row per taxon + year + aggregated appendix, which was easy to work with but also resulted in huge mviews, which would slow down the validation (e.g. ~1mln rows for the valid annex mview, compared to ~24k). In addition, those mviews worked incorrectly for taxa that had been deleted / excluded from the listing. The new structure has a row per taxon + appendix + interval when the appendix was applicable.