Skip to content

Conversation

GiovaniGuizzo
Copy link
Contributor

Checklist for Pull Requests

  • All tests pass (yarn test:all and yarn test:integration)
  • Code follows the style guide and passes lint checks
  • Documentation is updated (README, docs, etc)
  • Linked to corresponding issue, if applicable

Summary of Changes

Closes #62

  • Creates schema automatically if it does not exist
  • New tests for schema

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes PostgreSQL migrations to work correctly with custom schemas by ensuring the schema exists before running migrations and setting the schema name for migration tracking.

  • Adds schema creation logic to PostgresBackend's migrate method
  • Extracts schema name from searchPath configuration and applies it to Knex migrations
  • Creates comprehensive test coverage for schema-based operations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/backends/postgres/src/postgres-backend.ts Implements schema extraction from searchPath, adds ensureSchemaExists method, and overrides migrate to create schema before running migrations
packages/backends/postgres/test/with-schema.test.ts Adds test coverage for PostgresBackend with custom schema configuration

Copy link
Contributor

@merencia merencia left a comment

Choose a reason for hiding this comment

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

LGTM

@GiovaniGuizzo GiovaniGuizzo merged commit 686afa5 into master Aug 11, 2025
2 checks passed
@GiovaniGuizzo GiovaniGuizzo deleted the fix/fixed-schema-migrations branch August 11, 2025 12:30
sidequest-release bot pushed a commit that referenced this pull request Aug 11, 2025
## [1.4.3](v1.4.2...v1.4.3) (2025-08-11)

### Bug Fixes

* set schema name for migrations based on searchPath in PostgresBackend ([#67](#67)) ([686afa5](686afa5))
@sidequest-release
Copy link

🎉 This PR is included in version 1.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Postgres Driver Custom Schema
2 participants