Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: invoke deprecated methods in default supports method for backwards compatibility #5897

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@
import liquibase.statement.DatabaseFunction;
import liquibase.statement.SqlStatement;
import liquibase.structure.DatabaseObject;
import liquibase.structure.core.ForeignKey;
import liquibase.structure.core.Index;
import liquibase.structure.core.PrimaryKey;
import liquibase.structure.core.UniqueConstraint;
import liquibase.structure.core.*;
import liquibase.util.StringUtil;

import java.io.IOException;
Expand Down Expand Up @@ -372,6 +369,7 @@
*
* @deprecated Know if you should quote the name or not, and use {@link #escapeColumnName(String, String, String, String)} which will quote things that look like functions, or leave it along as you see fit. Don't rely on this function guessing.
*/
@Deprecated
String escapeColumnName(String catalogName, String schemaName, String tableName, String columnName, boolean quoteNamesThatMayBeFunctions);

/**
Expand All @@ -392,7 +390,22 @@
@Deprecated
boolean supportsCatalogs();

/**
* Whether this database supports the specified object type.
* It is invoking the deprecated methods to ensure that extensions are not broken, but
* once those are removed it will return only true
*
* @param object the object type to check
* @return true if the database supports the object type, false otherwise
*/
default boolean supports(Class<? extends DatabaseObject> object) {
if (Sequence.class.isAssignableFrom(object)) {
return supportsSequences();
Dismissed Show dismissed Hide dismissed
} else if (Schema.class.isAssignableFrom(object)) {
return supportsSchemas();
Dismissed Show dismissed Hide dismissed
} else if (Catalog.class.isAssignableFrom(object)) {
return supportsCatalogs();
Dismissed Show dismissed Hide dismissed
}
return true;
}

Expand Down Expand Up @@ -500,6 +513,7 @@
* removing set schema or catalog names if they are not supported
* @deprecated use {@link liquibase.CatalogAndSchema#standardize(Database)}
*/
@Deprecated
CatalogAndSchema correctSchema(CatalogAndSchema schema);

/**
Expand Down