update schema to add buildenv_id to packageinstance table.
Fix build_env_id references in packageinstance.