Changed default sorting to prioritize non-nullable fields

This commit is contained in:
Francesco 2023-09-30 11:19:21 +02:00
parent 90da830030
commit 1db41bad38

View File

@ -209,6 +209,12 @@ public class DbObjectSchema {
return -1; return -1;
if (b.isPrimaryKey() && !a.isPrimaryKey()) if (b.isPrimaryKey() && !a.isPrimaryKey())
return 1; return 1;
if (!a.isNullable() && b.isNullable())
return -1;
if (a.isNullable() && !b.isNullable())
return 1;
return a.getName().compareTo(b.getName()); return a.getName().compareTo(b.getName());
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }