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

Added new argument to preserve schema case DAT-10027 #2888

Merged
merged 17 commits into from
Jun 15, 2022
Merged

Conversation

wwillard7800
Copy link
Contributor

Environment

Liquibase Version:

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>

Liquibase Extension(s) & Version:

Database Vendor & Version:

Operating System Type & Version:

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue.)
  • Enhancement/New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

A clear and concise description of the issue being addressed. Additional guidance here.

  • Describe the actual problematic behavior.
  • Ensure private information is redacted.

Steps To Reproduce

List the steps to reproduce the behavior.

  • Please be precise and ensure private information is redacted
  • Include things like
    • Files used - sql scripts, changelog file(s), property file(s), config files, POM Files
    • Exact commands used - CLI, maven, gradle, spring boot, servlet, etc.

Actual Behavior

A clear and concise description of what happens in the software before this pull request.

  • Include console output if relevant
  • Include log files if available.

Expected/Desired Behavior

A clear and concise description of what happens in the software after this pull request.

Screenshots (if appropriate)

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

Fast Track PR Acceptance Checklist:

Need Help?

Come chat with us in the Liquibase Forum.

@github-actions
Copy link

github-actions bot commented May 27, 2022

Unit Test Results

  4 548 files  ±0    4 548 suites  ±0   31m 52s ⏱️ +21s
  4 508 tests ±0    4 294 ✔️ +4     214 💤  - 4  0 ±0 
53 376 runs  ±0  48 368 ✔️ +4  5 008 💤  - 4  0 ±0 

Results for commit dd7b14e. ± Comparison against base commit 8f1c3da.

♻️ This comment has been updated with latest results.

@kataggart kataggart added this to To Do in Conditioning++ via automation May 30, 2022
@suryaaki2 suryaaki2 self-requested a review May 31, 2022 17:06
@@ -188,6 +189,11 @@ public class GlobalConfiguration implements AutoloadedConfigurations {
.setDefaultValue(true)
.build();

PRESERVE_SCHEMA_CASE = builder.define("preserveSchemaCase", Boolean.class)
.setDescription("Should Liquibase preserve the original case of schemas")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe describe this as "Should liquibase treat schema and catalog names as case sensitive?"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it

@@ -297,7 +297,8 @@ public String correctObjectName(String objectName, Class<? extends DatabaseObjec
if (objectName.contains("-")
|| hasMixedCase(objectName)
|| startsWithNumeric(objectName)
|| isReservedWord(objectName)) {
|| isReservedWord(objectName)
|| Boolean.TRUE.equals(GlobalConfiguration.PRESERVE_SCHEMA_CASE.getCurrentValue())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make it so that postgresql preserve the case on ALL objects if preserveSchemaCase is set?

I think you need to take this out of this if block and put it as a separate if block checking the objectType as the first lines of this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I see your point. Testing didn't find any issues, but maybe they just didn't hit one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't have seen any issues in my manual testing because my non-schema objects were all lowercase for the Postgres tests. Even in the automated functional tests, we generally use the default casing for any given database platform unless we are specifically testing casing. If there is/was an issue, I can see why test would not have seen it.

@suryaaki2 suryaaki2 merged commit 627c74a into master Jun 15, 2022
Conditioning++ automation moved this from To Do to Done Jun 15, 2022
@suryaaki2 suryaaki2 deleted the DAT-10027 branch June 15, 2022 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants