Can't create schema due to cyclic fk references
See original GitHub issueI have a User model. I want a one to one relation between two users.
spouse = fields.ForeignKeyField('models.User', on_delete=fields.SET_NULL, null=True)
But i get this error:
tortoise.exceptions.ConfigurationError: Can't create schema due to cyclic fk references
Any help?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
tortoise/community - Gitter
ConfigurationError: Can't create schema due to cyclic fk references. Do you know how i can get this sorted out ? And why would...
Read more >Foreign Key cyclic reference Dilemma - mysql - Stack Overflow
The problem which I am facing here is that this results in a cyclic reference between the users and the workgroups table. Since...
Read more >Is it acceptable to have circular foreign key references\How to ...
No, it's not acceptable to have circular foreign key references. Not only because it would be impossible to insert data without constantly dropping...
Read more >How to deal with cyclic foreign keys - Thoughts about SQL
Sometimes cyclic foreign keys can't be avoided, but modern SQL ... alter table department add foreign key (manager_id) references employee; ...
Read more >MySQL Bugs: #89696: Cyclic dependencies are not resolved ...
Cannot delete or update a parent row: a foreign key constraint fails ... CREATE SCHEMA `cascade`; USE `cascade`; CREATE TABLE table1 ( id ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@grigi I am sorry I haven’t been able to get to this in last two days. I am going to look at this over the weekend and get it done. Sorry for the delay.
Hello there, I’m getting the same error after I removed the foreign key from the model.