Skip to content

void db push on D1 asks to delete Void's migration journal after void db migrate #976

In progress

Description

@hyfdev

On local D1, once void db migrate has applied a migration, adding a column and running void db push asks to delete Void's migration journal:

· You're about to delete _void_migrations table with 1 items

THIS ACTION WILL CAUSE DATA LOSS AND CANNOT BE REVERTED

Do you still want to push changes?

Without a terminal, as in CI, the prompt fails and the database stays unchanged, but void db push still exits 0:

Error: Interactive prompts require a TTY terminal (process.stdin.isTTY or process.stdout.isTTY is false). …
✓ Database schema pushed.

Choosing "No, abort" in a terminal also prints "✓ Database schema pushed." and exits 0.

To reproduce in Void 1.12.2:

  1. In an empty directory, run npm install -D void@1.12.2 and npx void init. Keep the defaults, but choose "Skip deployment setup".
  2. Run npx void db migrate.
  3. Add note: text('note') to messages in db/schema.ts, run npx void db push, and choose "No, abort".
  4. Run npx void db push < /dev/null to see what happens without a terminal.

Void runs Drizzle Kit without a table filter, so Kit tries to delete the journal because it isn't in the schema.

Kit also exits 0 when a prompt fails or is declined, and Void reports that as success.

#935 fixes it.

Activity

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

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions