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

fix: Use ALTER for managing PUBLIC schemas that exist #2973

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

sfc-gh-jmichalak
Copy link
Collaborator

  • during create operation, detect if PUBLIC schema has already been created, and instead of using OR REPLACE, redirect the flow to UpdateContextSchema (note that name change needs to be excluded to avoid unnecessary rename)
  • add a check to acceptance tests to ensure the schema hasn't been dropped
  • describe new behavior in the migration guide for v0.94.1 and add a note for v0.94.0

Test Plan

  • acceptance tests

References

References #2826, specifically comment #2826 (comment)

MIGRATION_GUIDE.md Outdated Show resolved Hide resolved
MIGRATION_GUIDE.md Outdated Show resolved Hide resolved
pkg/resources/schema.go Outdated Show resolved Hide resolved
if err != nil {
return diag.FromErr(err)
}
create := true
Copy link
Collaborator

Choose a reason for hiding this comment

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

TBH I would prefer an explicit separation here, i.e.:

  • if name is not PUBLIC -> run create
  • otherwise if does not exist -> run create
  • otherwise -> run update

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Simplified a bit.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not a separation like I asked for. Now the execution path is still not clear.

Let's leave it like this, and will follow up and do it in the following PRs. I will keep it open for the time-being.

pkg/resources/schema_acceptance_test.go Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Aug 1, 2024

Integration tests failure for 8b3c88dd73d35bd98911d0adeb78cea3365bbf6a

Copy link

github-actions bot commented Aug 1, 2024

Integration tests failure for d95252b0701ca754f28c754dd4b641cc11e92f7f

Copy link

github-actions bot commented Aug 2, 2024

Integration tests failure for 30547cadada7df3f617caa04f50514be529b7c76

sfc-gh-jcieslak
sfc-gh-jcieslak previously approved these changes Aug 2, 2024
pkg/resources/schema_acceptance_test.go Show resolved Hide resolved
@sfc-gh-asawicki sfc-gh-asawicki self-requested a review August 2, 2024 11:58
quotedIdentifiersIgnoreCase,
enableConsoleOutput,
err := GetAllDatabaseParameters(d)
// there is no PUBLIC schema, so we continue with creating
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: or the name is completely different than PUBLIC, we will handle this in the next PR

Copy link

github-actions bot commented Aug 2, 2024

Integration tests failure for a51e435066738ee38b06af2ea22da20a93b42a55

@sfc-gh-jmichalak sfc-gh-jmichalak merged commit 567e9be into main Aug 2, 2024
8 of 9 checks passed
@sfc-gh-jmichalak sfc-gh-jmichalak deleted the fix-public-schema branch August 2, 2024 13:18
sfc-gh-jmichalak pushed a commit that referenced this pull request Aug 2, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.94.1](v0.94.0...v0.94.1)
(2024-08-02)


### 🐛 **Bug fixes:**

* Use ALTER for managing PUBLIC schemas that exist
([#2973](#2973))
([567e9be](567e9be))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants