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] Unable to delete rom when using PostgreSQL #1441

Open
rhombuslabs opened this issue Jan 8, 2025 · 1 comment
Open

[Bug] Unable to delete rom when using PostgreSQL #1441

rhombuslabs opened this issue Jan 8, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@rhombuslabs
Copy link

RomM version
3.7.0

Describe the bug
A SQL error is produced when removing a game from RoMM

To Reproduce
Steps to reproduce the behavior:

  1. Configure an instance of RomM with a postgres database. Use the default postgres user to create the database and to access it from RomM.
  2. Add games to your collection
  3. Choose any added file
  4. Perform the Remove operation on that file
  5. A SQL error notification pops up (see screenshot)
  6. Observe that the file you attempted to remove still appears in the Library.
  7. Attempt to remove again, and see another error claiming that the row ID doesn't exist.

Expected behavior
The file is removed from the Library without error.

Screenshots

image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version 131

Additional context

I'm running RomM as a docker image on Unraid.

I presume that this might be a problem with the recent postgres feature. I used the default postgres account to create the database and I specified the same user in the Docker config. I figure it has full rights to perform all operations.

@rhombuslabs rhombuslabs added the bug Something isn't working label Jan 8, 2025
@rhombuslabs
Copy link
Author

The bug can be repro'd either directly from your library or from the search screen, as is the case in the screenshot.

@adamantike adamantike self-assigned this Jan 8, 2025
@adamantike adamantike changed the title [Bug] Bug title [Bug] Unable to delete rom when using PostgreSQL Jan 8, 2025
adamantike added a commit that referenced this issue Jan 9, 2025
Fix `json_array_contains_value` function to use the `@>` operator for
checking if a JSON array contains a value in PostgreSQL. This is
necessary because the `has_key` function only works for string values.

Also, remove `get_rom_collections` method, as it was doing the same
thing as `get_collections_by_rom_id`.

Fixes #1441.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants