[jOOQ/jOOQ#11287] NullPointerException in AbstractMeta.copyFK for SQLite
when a foreign key references a unique key
This commit is contained in:
parent
dc528e2f46
commit
6bca99f0db
@ -250,7 +250,15 @@ final class Snapshot extends AbstractMeta {
|
||||
// ReferenceImpl in this list until we "know better"?
|
||||
for (int i = 0; i < foreignKeys.size(); i++) {
|
||||
ForeignKey<R, ?> fk = foreignKeys.get(i);
|
||||
foreignKeys.set(i, copyFK(this, lookupUniqueKey(fk), fk));
|
||||
UniqueKey<?> uk = lookupUniqueKey(fk);
|
||||
|
||||
// [#10823] [#11287] There are numerous reasons why a UNIQUE
|
||||
// constraint may not be known to our meta model. Let's just
|
||||
// prevent exceptions here
|
||||
if (uk == null)
|
||||
foreignKeys.remove(i);
|
||||
else
|
||||
foreignKeys.set(i, copyFK(this, uk, fk));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user