0

The concrete problem is having a vast database which is lacking foreign keys, which makes it difficult for developers to work on.

The plan was to add disabled foreign keys to it initially, which would allow generating EER diagrams from the DB and would increase developer productivity, but from what I could find, it is not possible to have disabled foreign keys when using the InnoDB storage engine.

A solution to the DB understanding problem could be creating an EER diagram using MySQL Workbench and sharing it, but that would cause a lot of issues regarding synchronization, awareness of it, etc.

Long term plan would be to enable the FKs over time with all the necessary precautions.

Is there any way I can create disabled FKs when using InnoDB?

What other suggestion would you have for the concrete problem of generating DB diagrams with FKs connecting the tables?

  • A nice example of an X-Y Problem™. You need to document your database, and you think the way to do it is to add disabled RI constraints. But may be it's not. – mustaccio Jun 26 at 12:00
  • @mustaccioit is not an X-Y problem since I described what my target goal is: developer productivity. What I mentioned are just examples of possible solutions. – Răzvan Flavius Panda Jun 26 at 16:48
  • I have to partially agree with your comment: it is not an X-Y problem, it seems to be an X-Z problem, since the issue of foreign keys is twice detached from your ultimate goal. – mustaccio Jun 26 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.