Skip to content

Add EnsureSchema function to create database schema#11

Merged
andrew-corbalt merged 2 commits into
mainfrom
acremins-ensure-schema
Nov 11, 2025
Merged

Add EnsureSchema function to create database schema#11
andrew-corbalt merged 2 commits into
mainfrom
acremins-ensure-schema

Conversation

@andrew-corbalt
Copy link
Copy Markdown
Contributor

PR Description

As we refactor for RDS IAM, ConnectWithSchema() will be deprecated and this EnsureSchema() helper function will handle the creation of a schema if it does not exist which was previously handled within ConnectWithSchema()

Tests:
This function was used to perform migrations against a local postgres DB.

PR Checklist

  • New automated tests have been written to the extent possible.
  • The code has been checked for structural/syntactic validity.
    • AMI/application: a build was performed
    • terraform changes: "terraform plan" checked on every affected environment
  • (If applicable) the code has been manually tested on our infrastructure.
    • AMI/application: deployed an a test or dev environment
    • terraform changes: applied to test or dev environment
    • script: run against test or dev environment
  • Likely failure points and new functionality have been identified and tested manually.
    Examples:
    • Application manually run in a way that triggers any new branches
    • AMI logged into and changes verified from login shell
  • Pull request description includes a description of all the manual steps performed to accomplish the above.

To provide feedback on this template, visit https://docs.google.com/document/d/1YfTv7Amyop5G_8w1c2GJ_Mu-70L0KkZHhm9f9umDi3U/edit

Copy link
Copy Markdown
Contributor

@hundt-corbalt hundt-corbalt left a comment

Choose a reason for hiding this comment

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

LGTM! Might be worth adding a comment that this requires CREATE privileges even if the schema already exists and it would be a no-op.

Added comment to clarify permissions needed for EnsureSchema function.
@andrew-corbalt andrew-corbalt merged commit fa65d54 into main Nov 11, 2025
1 check passed
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.

2 participants