theforeman/foreman — pull request #1413 by domcleal (2014-04-30 11:07:16+00:00)
Title: fixes #5427 - skip user roles FK removal if it's missing

FKs can be missing if a user migrated (e.g. from sqlite to pgsql) or used the old 'mysql' adapter which didn't support them.

You can test this by comment out the add_foreign_key line in db/migrate/20131114084718_extend_user_role.rb, migrating down VERSION=20131114084718, then migrating up again.