better handle activation function for backwards compatability. #847
make sql init script idempotent