You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
coder --version: Coder v0.0.0-devel+c034e83 Wed May 18 23:15:19 UTC 2022 c034e83
Steps to Reproduce
create a template from an example like gcp-linux
delete it with coder templates delete gcp-linux
recreate the same template with the same name
status code 500: execute transaction: insert template: pq: duplicate key value violates unique constraint "templates_organization_id_name_key"
Expected
You should be able to recreate templates
Actual
We are not clearing columns that have unique constraints, so you can't create a template with the same name twice in the same org.
Logs
Screenshot
Notes
In v1 we resolved this problem when we soft-deleted users by randomizing all of the unique fields (i.e. setting to a random UUID). Seems like this could be solved by renaming the template to a new UUID on deletion.
The text was updated successfully, but these errors were encountered:
kylecarbs
changed the title
Bug: deleting a template and recreating it causes 500 errors
Deleting a template and recreating it causes 500 errors
Jun 7, 2022
Uh oh!
There was an error while loading. Please reload this page.
OS Information
coder --version
: Coder v0.0.0-devel+c034e83 Wed May 18 23:15:19 UTC 2022c034e83
Steps to Reproduce
gcp-linux
coder templates delete gcp-linux
status code 500: execute transaction: insert template: pq: duplicate key value violates unique constraint "templates_organization_id_name_key"
Expected
You should be able to recreate templates
Actual
We are not clearing columns that have unique constraints, so you can't create a template with the same name twice in the same org.
Logs
Screenshot
Notes
In v1 we resolved this problem when we soft-deleted users by randomizing all of the unique fields (i.e. setting to a random UUID). Seems like this could be solved by renaming the template to a new UUID on deletion.
The text was updated successfully, but these errors were encountered: