Foreign Key constraint followed by Unique constraint fails to execute