db push applies migrations when the confirmation answer is not yes or no
Maintainer thường phản hồi trong vòng 1 ngày
@7ttp đang làm issue này rồi.
Từ ngày 28/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Affected area
Migrations
Supabase CLI version
2.107.0 (Homebrew). The CLI also reported that 2.118.0 is available.
Operating system
macOS (darwin 25.6.0, arm64)
Installation method
brew (/opt/homebrew/bin/supabase, package [email protected])
Command
supabase db push
At the confirmation prompt the answer entered was u, then Enter. That is not y or n.
Actual output
Do you want to push these migrations to the remote database?
• <pending-migration>.sql
[Y/n] u
Applying migration <pending-migration>.sql...
Finished supabase db push.
A second supabase db push then reported Remote database is up to date. The migration had been applied.
Expected behavior
[Y/n] means Enter, y, and yes confirm, and n and no decline. Any other non-empty answer should be rejected.
On an interactive terminal the prompt should say the answer was not recognized and ask again. It should not apply migrations. When stdin is not a terminal, a non-empty unrecognized answer should fail the command instead of taking the default. An empty line can still take the default, which is what Enter means.
Steps to reproduce
- Use Supabase CLI 2.107.0, linked to a remote project that has at least one pending migration.
--dry-runshows the same prompt path without writing. - Run
supabase db push. - At
[Y/n], typeuand press Enter. - The pending migration is applied.
The same parser is what makes printf 'u\n' dangerous anywhere this prompt reads a line and the default is yes.
Additional context
On 2.107.0, db push confirms through PromptYesNo in apps/cli-go/internal/utils/console.go, called with the default set to true from apps/cli-go/internal/db/push/push.go. parseYesNo accepts only y/yes/n/no. Any other non-empty string, including u, returns nil, and PromptYesNo then returns the default:
input, err := c.PromptText(ctx, labelWithChoice)
if len(input) > 0 {
if answer := parseYesNo(input); answer != nil {
return *answer, nil
}
}
return def, err
There is no re-prompt and no message that the input was ignored. For db push, def is true, so a typo applies remote migrations.
On current develop (and the 2.118.0 tree), apps/cli-go/internal/db/push/push.go is gone and interactive db push goes through promptYesNo in apps/cli/src/command-internal/prompt-yes-no.ts. A real TTY uses clack confirm, where y and n submit immediately and Enter submits the initial value. That interactive UI does not show the [Y/n] u line from 2.107.0. The shared fallback is still there for a non-TTY read: a non-empty line that parseYesNo does not understand falls through to defaultValue, and db push passes true. The Go PromptYesNo helper is also still used by other confirmations (db reset, migration repair, migration down, seed buckets) with the same fallback.
I am not opening a pull request yet. CONTRIBUTING.md says an external PR has to wait until this issue is open and carries open-for-contribution, and .github/scripts/contribution-gate.ts closes PRs that skip that. Happy to send the fix once that label is on.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.4k
- Fork
- 526
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 307
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của supabase/cli
-
Migration error caret is missing or misplaced when the statement contains multibyte charactersĐang mở🐛 Bug supabase/cli
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug supabase/cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
SQL statement splitter breaks E'...' strings that contain a backslash-escaped quoteCó thể đã có người làm @7ttp đã nhận 1 ngày trước. Đang mở🐛 Bug supabase/cli
supabase/cli#6885 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug supabase/cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🐛 Bug supabase/cli
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
opensearch-project/security-dashboards-plugin#2545 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Dream TR SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
SocialGouv/egapro#4672 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:agents area:tui bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
anthropics/claude-code#98358 ·
Maintainer thường phản hồi trong vòng 1 ngày