Generating SQL from MySQL in Dependency Order with DataGrip


I'm new to DataGrip, and I've run into an issue while generating SQL from a MySQL database containing a lot of views. I need to create a new MySQL database using the generated SQL. The problem I'm facing is that most tools, including DataGrip, create the SQL based on the alphabetical order of the objects.

For instance, I have a view named "A001" which depends on another view called "Z001". However, when I generate the SQL, "A001" is created before "Z001", causing errors due to unresolved dependencies.

Does anyone know how I can generate SQL using DataGrip (or another tool) based on the dependency order of the views? Or should I consider an alternative approach to handle this situation? Any advice or suggestions would be greatly appreciated.

Thanks in advance for your help!

Best regards, Rif

1 comment


Unfortunately, this is known issue:, please follow and vote to get noticed on any updates.


Please sign in to leave a comment.