mi_plan update fixes & add new foreign_key
generate schema
Merge branch 'bug_10358_and_9843' into staging

Conflicts:
	db/schema.rb