Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`resource_configs` unique constraint is ineffective #2509

Closed
vito opened this Issue Aug 20, 2018 · 2 comments

Comments

1 participant
@vito
Copy link
Member

vito commented Aug 20, 2018

We have a single UNIQUE constraint spanning 3 columns:

  • resource_cache_id
  • base_resource_type_id
  • source_hash

This won't actually work because one of resource_cache_id or base_resource_type_id will always be NULL.

@vito vito added the bug label Aug 20, 2018

@vito vito added this to Icebox in Core via automation Aug 20, 2018

@vito vito moved this from Icebox to Backlog in Core Aug 20, 2018

@vito

This comment has been minimized.

Copy link
Member Author

vito commented Aug 21, 2018

I guess we should just replace this with two unique constraints: one on (resource_cache_id, source_hash) and one on (base_resource_type_id, source_hash).

@vito vito added the blocked label Aug 27, 2018

@vito

This comment has been minimized.

Copy link
Member Author

vito commented Aug 27, 2018

blocking this on completion of #2386

@clarafu clarafu moved this from Backlog to In Flight in Core Oct 2, 2018

clarafu added a commit that referenced this issue Oct 2, 2018

atc: split resource configs unique constraint
The previous unique constraint was never used because one of the fields
are nil and you cant do a conflict with a nil value. The constraint was
split into two (base resource type, source hash) and (resource cache,
source hash) to respect the two possible resource configs.

#2509

Signed-off-by: Krishna Mannem <kmannem@pivotal.io>

@clarafu clarafu moved this from In Flight to Done in Core Oct 2, 2018

@vito vito added the accepted label Oct 3, 2018

@vito vito closed this Oct 3, 2018

@vito vito added this to the v5.0.0 milestone Jan 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.