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

Bug: CLI group creation does not auto-increment ID #2

Open
robere2 opened this issue Mar 6, 2023 · 1 comment
Open

Bug: CLI group creation does not auto-increment ID #2

robere2 opened this issue Mar 6, 2023 · 1 comment
Labels
Complexity: LOW This issue is trivial and is expected to take less than an hour to complete. Module: API This issue pertains to the apps/api module Priority: MED This issue isn't critical or security-related but is holding back other issues or efficiency. Type: Bug Something isn't working

Comments

@robere2
Copy link
Member

robere2 commented Mar 6, 2023

In the CLI, the ID is manually set when creating groups, which causes PostgreSQL to not increment the auto-increment value for the ID column. When a user tries to insert another group, it will always fail, since the auto-increment value is still set to 1 however a group with ID 1 already exists ("Guest").

There are two possible solutions to this:

  1. Do not insert the ID manually, and then assert that the IDs are correct at the end of the insert(s).
  2. Insert the IDs manually and then manually update the auto-increment value afterwards.

Technically, the ID of the groups shouldn't matter, but in my opinion, we should assert that the default groups are IDs 1-3 just in case.

@robere2 robere2 added Type: Bug Something isn't working Priority: MED This issue isn't critical or security-related but is holding back other issues or efficiency. labels Mar 6, 2023
@robere2
Copy link
Member Author

robere2 commented Apr 11, 2023

auto-increment value can be updated via:

SELECT setval('groups_id_seq', (SELECT MAX(id) FROM groups) + 1, false);

This can also be done manually until this issue is fixed.

@robere2 robere2 transferred this issue from rpitv/glimpse-api Jan 1, 2024
@robere2 robere2 added the Module: API This issue pertains to the apps/api module label Jan 1, 2024
robere2 added a commit that referenced this issue Jan 7, 2024
robere2 added a commit that referenced this issue Jan 7, 2024
@robere2 robere2 added the Complexity: LOW This issue is trivial and is expected to take less than an hour to complete. label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: LOW This issue is trivial and is expected to take less than an hour to complete. Module: API This issue pertains to the apps/api module Priority: MED This issue isn't critical or security-related but is holding back other issues or efficiency. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant