Skip to content

Sidecar PostgreSQL objects are absent from one schema drift plan #82

Open

Description

@denisvmedia

Hi Francesco,

I read your post about the Atlas workarounds. The extra handling you described for search and vector objects is what led me to try Ptah with Rebase. I’m the author of Ptah, an independent schema tool with an Atlas-compatible CLI.

TL;DR: I’d like to replace Atlas CE with Ptah Compat behind Rebase’s existing database commands, so they can plan the full declared schema while keeping the current migration files and history.

The benefit I’m aiming for is practical: changing only a policy, function, trigger, search/vector definition, or declared view should produce a migration through db generate. db push --dry-run should show their changes alongside table changes. Rebase already generates and applies these objects, but keeping them outside the planner means extra handling and, in some cases, asking users to add SQL to migrations by hand.

I opened #84 to implement this. I want to keep the change focused: generate the complete desired state from Rebase’s existing declarations, pass it to Compat, and remove the corresponding Atlas-specific post-processing as those objects move into the planner. Users would keep the same commands, SQL migration files, atlas.sum, and revision records.

We tested Ptah against a Rebase fixture and repaired five deliberate changes across a policy, a function, two indexes, and a trigger. That experiment used Native and manually prepared SQL; the PR needs to deliver this through Rebase’s normal commands.

My intention is for #84 to close this issue once that integration works for existing projects, managed PGlite, and external PostgreSQL, while preserving unmanaged objects and Rebase’s auth/extension provisioning. An optional export alone would leave the main problem unresolved.

Would you be open to this approach?

Activity

  1. denisvmedia commented on Nov 19, 2026

    @denisvmedia
    Author

    @fgatti675 the implementation in #84 and the documentation in #86 are ready for review.

    With #84, the existing db generate and db push commands use Ptah Compat to plan changes to declared policies, functions, triggers, search and vector indexes, and views alongside table changes. Existing SQL migrations, atlas.sum, and revision records carry over. I verified the workflow on managed PGlite and external PostgreSQL.

    The upgrade path targets Rebase 0.35.0. The documentation in #86 follows #84.

    P.S. #84 is pretty big, but it's because as an external contributor I cannot create stacked PRs. Instead I organized the PR into semantical commits, so you can see and review them here individually: https://github.com/rebasepro/rebase/pull/84/commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions