I have created two tables employee and department.
An employee
has the following attribute:
1. id
2. Name
3. Department(fk, refer to department id )
Department
:
1. id
2. HeadOfDepartment(fk, refer to employee id)
As it is pretty clear from above statement, cyclic dependency exists between this two table.
When I run the statement to create this two table using sequelize, it throws "cyclic dependency error
", And as suggested by stack overflow, I introduced an attribute called "constraint" and set it to false. and when I query the structure of above table, there was no constraint which means there was no association. Is there any route, where I can create a table with cyclic dependency without introducing the third table and without using "Alter " statement.