Database migrations and undo contracts deletion