Table <str> has no primary key Explanation: You omitted the referenced column list in a referential constraint for which the referenced table has no PRIMARY KEY. If the referenced table has no primary key, you must specify a column list which matches the columns in a UNIQUE constraint. User Action: Add a referenced column list, or define a PRIMARY KEY for the referenced table.