Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcb2d1f4

Browse files
authored
fix: ci uses a migrated DB template (#2696)
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent576aef4 commitcb2d1f4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

‎Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ test: test-clean
172172
.PHONY: test
173173

174174
test-postgres: test-clean test-postgres-docker
175-
DB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." --\
175+
DB=ciDB_FROM=$(shell go run scripts/migrate-ci/main.go) gotestsum --junitfile="gotests.xml" --packages="./..." --\
176176
-covermode=atomic -coverprofile="gotests.coverage" -timeout=30m\
177177
-coverpkg=./...,github.com/coder/coder/codersdk\
178178
-count=2 -race -failfast

‎scripts/migrate-ci/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,14 @@ func main() {
2727
panic(err)
2828
}
2929

30-
err=database.MigrateUp(db)
30+
targetURL:=fmt.Sprintf("postgres://postgres:postgres@127.0.0.1:5432/%s?sslmode=disable",dbName)
31+
target,err:=sql.Open("postgres",targetURL)
32+
iferr!=nil {
33+
panic(err)
34+
}
35+
defertarget.Close()
36+
37+
err=database.MigrateUp(target)
3138
iferr!=nil {
3239
panic(err)
3340
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp