Fix constraints and indexes failures on db creation (bug 1095956)