Browse Source

Pull request #2680: DEC-19255 fix 对之前主键丢失的客户表做npe处理

Merge in CORE/base-third from ~ELIJAH/base-third:final/10.0 to final/10.0

* commit 'c548571fbd1c044e56c9ad0c7f9bd0e2295f43de':
  DEC-19255 fix 对之前主键丢失的客户表做npe处理
final/10.0
Kara 3 years ago
parent
commit
1687ac2458
  1. 4
      fine-hibernate/src/main/java/com/fr/third/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java

4
fine-hibernate/src/main/java/com/fr/third/org/hibernate/tool/schema/internal/AbstractSchemaMigrator.java

@ -362,7 +362,9 @@ public abstract class AbstractSchemaMigrator implements SchemaMigrator {
Set<Identifier> identifiers = getUniqueKeyIdentifiers(table);
if (tableInfo != null) {
for (IndexInformation indexInfo : tableInfo.getIndexes()) {
if (!indexInfo.isUnique() || indexInfo.getIndexIdentifier().equals(tableInfo.getPrimaryKey().getPrimaryKeyIdentifier())) {
PrimaryKeyInformation primaryKey = tableInfo.getPrimaryKey();
//主键不存在时npe处理
if (!indexInfo.isUnique() || (primaryKey != null && indexInfo.getIndexIdentifier().equals(primaryKey.getPrimaryKeyIdentifier()))) {
continue;
}
//如果旧的唯一键已经不存在, 则删除

Loading…
Cancel
Save