See https://www.schemacrawler.com/lint.html - Linter: schemacrawler.tools.linter.LinterForeignKeySelfReference Checks tables where the foreign key self-references the primary key. This means that a record in the table references itself, and cannot be deleted. https://github.com/schemacrawler/SchemaCrawler/blob/v16.24.3/schemacrawler-lint/src/main/java/schemacrawler/tools/linter/LinterProviderForeignKeySelfReference.java