Check id_user before to insert (PostgreSQL check) validation due id relationship

System Information
  • Strapi Version: 3.4.1
  • Operating System: macOS
  • Database: PostgreSQL
  • Node Version: v14.15.4
  • NPM Version: 6.14.10
  • Yarn Version: 1.22.10

Hi there, I’m new here.

How do I prevent the database from entering repeated data. I would like to prevent the user from voting twice in the same poll.

id_user id_poll if they already exist, do not insert. I saw that in Hasura this is possible, but I didn’t see how to do it in Strapi.

Kind regards,

Hermes Souza