Skip to content

Stackpress push does not create schemas when revision history is ahead of the database #12

Description

@cjzamora

What version of Inquire are you using?

@stackpress/inquire: 0.10.5 @stackpress/inquire-pg: 0.10.5 stackpress: 0.10.5

What OS are you experiencing this issue?

macOS Darwin 25.5.0 arm64

Describe the Bug

After updating schema.idea through a plugin schema file, stackpress generate correctly generated the client models and revision snapshots for new schemas, including Company and Onboarding.

However, yarn push completed successfully without creating the corresponding database tables. The generated client contained the schemas, and .build/revisions/*.json contained the models, but the live database did not have the company or onboarding tables. Running yarn push again produced no SQL and exited successfully.

This happened because push appears to diff only the latest revision snapshots. If revision history already contains a model but the live database is missing the table, push does not reconcile the database against the current schema.

Expected Behavior

Stackpress push should either:

  1. create missing tables that exist in the current generated schema, or
  2. detect that the live database is out of sync with revision history and report a clear error or warning.
    It should not silently succeed while required schema tables are missing from the database.

To Reproduce

  1. Create or update a plugin schema, for example plugins/onboarding/schema.idea, with new models such as Company and Onboarding.

  2. Include that schema from root schema.idea:

use "stackpress/stackpress.idea"
use "./plugins/onboarding/schema.idea"

Run:

yarn generate
  1. Confirm generated client and revisions include the new models.
  2. Ensure the live database does not yet have the corresponding tables.

Run:

yarn push
  1. Observe that yarn push exits successfully but does not create the missing tables.
  2. Run yarn push again and observe no SQL is emitted.

In our case, .build/migrations contained SQL for creating company and onboarding, but push did not apply those tables because the latest revision diff no longer considered them new.

Include git repo/fork so we can easily reproduce the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions