PostgresError: there is no unique constraint matching given keys for referenced table "table_name"
I am getting this error, I looked at the migration file and i cannot see anything that would cause this error, I am not referencing the table table_name anywhere other than creating foreign key constraints to the id of this table which exists so I am not sure how it would cause any errors
1 Reply
I get the exact same error, using:
My tables are as follows:
And the error I get:
And the error I get:
Seeing as drizzle creates the migration, I can't see what is wrong either.
Nvm, I fixed it with
.unique()
right after the uuid("id")
statement in each table: