add migration for creating entity ids for old entities
fix silly deadlock, make more resilient
fix specs
Merge branch 'master' into 711_sched_maint_invalid_entity
remove debugging output
move semaphore acquisition outside begin/ensure block
Merge pull request #717 from flapjack/711_sched_maint_invalid_entity

add migration for creating entity ids for old entities