Skip to content

db:migrate: show which database it targets and ask before applying #65

Closed

Description

@maaland

Why

pnpm db:migrate applies migrations to whatever DATABASE_URL points at, without saying which database that is. While several environments exist (local, Supabase), it's easy to migrate the wrong one, or to apply SQL by hand and forget to record it.

What to build

  • Before changing anything, print the target: host, database and user (for Supabase, the project ref), never the password.
  • List the migrations it would apply, or say it's up to date.
  • Ask for confirmation in a terminal; --yes skips the question (for scripts and CI). Without a terminal and without --yes, apply nothing.
  • --status prints the target and what's pending, and stops.

Done when

  • Running it shows the target and the pending list and waits for "y" before applying.
  • --status changes nothing.
  • The listing of pending migrations is tested.

Activity

  1. drippa-ai commented on Oct 12, 2026

    @drippa-ai

    Drippa Sign-Off: Show the target database and pending migrations, and confirm before db:migrate applies them

    ✅ Delivers ticket #65 — 4 of 5 outcomes

    Open in Drippa

    What was promised

    • ✅ Running the command shows the target database (host, database, user, Supabase project) without the password before doing anything.
    • ✅ It lists the migrations it would apply, or says the database is already up to date.
    • ✅ It waits for "y" in a terminal, applies without asking when given --yes, and applies nothing without a terminal and without --yes.
    • ⚠️ The status option shows the target and pending list and applies no migrations. On a fresh database it still creates the empty table that tracks migrations.
    • ✅ Listing pending migrations is covered by an automated test.

    Not tested in the browser: behaviour change with no page to click.

    Full review on the pull request


    Updated by Drippa • 2026-10-12 19:19 UTC

  2. added a commit that references this issue on Oct 12, 2026
    385a445
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