Schema integrity verification

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
zhekaus
Posts: 16
Joined: Wed 19 Aug 2015 10:05
Contact:

Schema integrity verification

Post by zhekaus » Thu 12 Oct 2017 09:14

During the database schema synchronization FOREIGN_KEY_CHECKS=0 is using.
That means, If I don’t import all the necessary tables, the schema may be incomplete.
Is there a way to check the the schema integrity to find all the missing foreign tables?

Looking forward for response,
Thanks in advance.
Last edited by zhekaus on Thu 12 Oct 2017 18:04, edited 1 time in total.

alexa

Re: Schema integrity verification

Post by alexa » Thu 12 Oct 2017 17:30

We will review this post and will answer you as soon as possible.

alexa

Re: Schema integrity verification

Post by alexa » Wed 18 Oct 2017 15:24

From the MySQL documentation, when setting FOREIGN_KEY_CHECKS=0, the table creation order does not depend on the foreign keys. Upon synchronization, all the objects should be created. You can check this by creating a test database and synchronizing it with the source one.

Also, you can use the 'Ignore foreign keys' synchronization option. In this case, the foreign keys will not affect the database synchronization. After that, you can exclude the option and create the foreign keys.

zhekaus
Posts: 16
Joined: Wed 19 Aug 2015 10:05
Contact:

Re: Schema integrity verification

Post by zhekaus » Thu 19 Oct 2017 05:56

Thank you very much for the response.

I made the check on my own. In fact, it is not so difficult. All is needed is stored in information_schema.

PS. Btw, I think it’s a good idea to have such a verification as a dbForge feature.

alexa

Re: Schema integrity verification

Post by alexa » Thu 19 Oct 2017 12:56

In our previous reply we were referring to another our product which is dbForge Schema Compare for MySQL.

Please note that there is the 'Disable foreign keys' option on the 'Options' page of the data synchronization wizard of dbForge Data Compare for MySQL. This option adds

Code: Select all

 FOREIGN_KEY_CHECKS=0
at the beginning of the script and

Code: Select all

FOREIGN_KEY_CHECKS=1
at the end.

Post Reply