SchemaDropperImpl does not drop constraints with IF EXISTS

Description

Hi,

I'm running tests on Postgres and it seems that dropping constraints do not include IF EXISTS before the constraint name.

E.g. I see similar logs to the one below:

Looking a bit into the code I noticed some problems:

  • Apparently ForeignKey.sqlDropString() that would respect Dialect.supportsIfExistsBeforeConstraintName() (or in fact any other sqlDropString() method) seems to be never called

  • Dialect.supportsIfExistsBeforeConstraintName() doesn't seem to be consistently applied. Constraint actually doesn't check it, ForeignKey does - but yet again: I can't see the call site of any sqlDropString(). StandardForeignKeyExporter.getSqlDropStrings() which is called in the process of dropping the schema doesn't respect those settings as well.

Any help and clarification is appreciated.

Cheers,
Christoph

Environment

None

Status

Assignee

Andrea Boriero

Reporter

Christoph Dreis

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure