Bad Diff due to unpredictable column order when using Generate SQL


Hey, I'm using this version of Datagrip:

DataGrip 2021.2
Build #DB-212.4746.86, built on July 26, 2021
Licensed to Aaron Massicotte
Subscription is active until April 15, 2022.
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.6
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Non-Bundled Plugins: bundled-datagrip-help (212.4746.86), com.intellij.CloudConfig (212.4746.58), (212.4746.58), org.jetbrains.plugins.yaml (212.4746.58), Docker (212.4746.92), PythonCore (212.4746.96), izhangzhihao.rainbow.brackets (6.19)

When working with an SQL database, I frequently backup the schema using the SQL Generator


The problem is that, as of about 2 months ago, the column order has been unpredictable. See diff below


Unfortunately, this makes the column order change in DataGrip, but also has a chance of causing bugs in code when the schema is used to regenerate a database. Of course, the diff makes the actual changes to the database unclear, which is also very annoying. The problem affects all tables in the database with more than 1 column. For example, I added 2 columns and 2 indexes to a table, and GitLab is showing 

Please sign in to leave a comment.