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

operator does not exist: integer = uuid #105

Open
gmverdon opened this issue Oct 19, 2018 · 4 comments
Open

operator does not exist: integer = uuid #105

gmverdon opened this issue Oct 19, 2018 · 4 comments

Comments

@gmverdon
Copy link

In my view I have the following line of code:

chat.messages.unread_by(@current_identity).length

However this results into the following error:

ActionView::Template::Error (PG::UndefinedFunction: ERROR:  operator does not exist: integer = uuid
LINE 3:                AND "read_marks".readable_id    = "messages"....

My messages have UUID's. Is there support for UUID'S?

@ledermann
Copy link
Owner

You need to change the generated migration to use UUIDs.

@franzejr
Copy link

franzejr commented Apr 9, 2019

Even changing it, it seems the error persists...

@elduglas
Copy link

Even changing it, it seems the error persists...

Hi, I'm sorry for my bad english. My solution was delete the column sluggable_id from friendly_id_slugs and add again the column but as uuid.

  def change
    remove_column :friendly_id_slugs, :sluggable_id
    add_column :friendly_id_slugs, :sluggable_id, :uuid
  end

😃

@topgunjoe
Copy link

This issue was occurring in my case because the primary key field type was UUID, however, the foreign key field type was int.

The mistmatch was causing the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants