posterior_id and ensemble_id where ints instead of bigint.

mistake, had all foreign ID's as ints, not bigints.
You mean PosteriorSamples (or PosteriorsSamples if you grant my wish), right?