Relative Content

Tag Archive for postgresqlsequelize.jssequelize-auto

error: there is no unique constraint matching given keys for referenced table ,despite it being a primary key constraint

Hey first time actually making questions on the site so i will try to be has detailed has possible.
Im trying to use sequelize auto to create the models and run them to create the relations of the tables using the file init-models.js( im portuguese so if i will try and translate the name of variables)
enter image description here
this image is my command prompt basicly i have 2 tables tipo_locais(typeof_places ex: fast food,park,wine gallery) and locais (places ex: burger king , viseu park) the tables seem to be organized so that they resemble my database creation script
enter image description here
this my tables that i created using my script, and the error seems to be complaining that my id_tipo_local variable isnt a primary key which doesnt seem right acording with this table