Database corruption while attaching project

@luisshulk Is this question related to Missing jobs after attaching project - #2 by luisshulk?