Skip to content

Commit f2d98fc

Browse files
authored
Merge pull request Wei-Shaw#1077 from Clov614/main
fix(auto setup): 修复初始测试连接硬编码问题导致使用自定义数据库测试失败无法执行 auto setup流程
2 parents 2b41cec + 47b7488 commit f2d98fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/internal/setup/setup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ func NeedsSetup() bool {
164164
func TestDatabaseConnection(cfg *DatabaseConfig) error {
165165
// First, connect to the default 'postgres' database to check/create target database
166166
defaultDSN := fmt.Sprintf(
167-
"host=%s port=%d user=%s password=%s dbname=postgres sslmode=%s",
168-
cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.SSLMode,
167+
"host=%s port=%d user=%s password=%s dbname=%s sslmode=%s",
168+
cfg.Host, cfg.Port, cfg.User, cfg.Password, cfg.DBName, cfg.SSLMode,
169169
)
170170

171171
db, err := sql.Open("postgres", defaultDSN)

0 commit comments

Comments
 (0)