NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Strange deployment filtering in Campaigns #600

Closed heidimok closed 7 months ago

heidimok commented 9 months ago

Problem

It appears like we are only showing one deployment per campaign at times. We have some weird filtering in order to try to retrieve only the latest draft of each deployment. But it's filtering out anything with duplicate model_instance_uuid values. The problem is a Change object doesn't get a model_instance_uuid value until it's published, so we will only display a single unpublished deployment.

Additional Information

edkeeble commented 7 months ago

Oh, reading the postgresql DISTINCT docs further:

Obviously, two rows are considered distinct if they differ in at least one column value. Null values are considered equal in this comparison.

So I guess we just need to update this query to not use DISTINCT.