Protect against bad data
Fix nullability and unique constraints in tables

These are the tables dealing with polymorphic relationships.
Add db migration for unique constraint on program_controls
Add association directive_controls
Merge pull request #302 from reciprocity/feature/log_events

55840662 Fix nullability and unique constraints in relationships; protect display_name against bad data