Scope only if column exists

This prevents problems with migrations from older versions