Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 58a029d

Browse files
nik-kcluca-nardellivolum-novaSuperSandro2000mkorolyov
authored
Signed-off-by: guoguangwu <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: occupyhabit <[email protected]> Signed-off-by: goodfirm <[email protected]> Co-authored-by: Luca Nardelli <[email protected]> Co-authored-by: Viktoria <[email protected]> Co-authored-by: Viktoria <[email protected]> Co-authored-by: Sandro <[email protected]> Co-authored-by: Maxim Korolyov <[email protected]> Co-authored-by: Jan Śreniawski <[email protected]> Co-authored-by: Rob Prentiss <[email protected]> Co-authored-by: Andreas Emilsson <[email protected]> Co-authored-by: Tommy Karlsson <[email protected]> Co-authored-by: Toby Scott <[email protected]> Co-authored-by: Jacopo Sabbatini <[email protected]> Co-authored-by: guoguangwu <[email protected]> Co-authored-by: Erik Swenson <[email protected]> Co-authored-by: Dale Hui <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Kucksdorf <[email protected]> Co-authored-by: Philip O'Toole <[email protected]> Co-authored-by: occupyhabit <[email protected]> Co-authored-by: goodfirm <[email protected]> Co-authored-by: Tim Rühsen <[email protected]> Co-authored-by: Mateusz Nowotyński <[email protected]> Co-authored-by: Galen Abell <[email protected]> Co-authored-by: Aditya Sharma <[email protected]> Co-authored-by: Shion Ichikawa <[email protected]> Co-authored-by: Muzammil Abdul Rehman <[email protected]> Co-authored-by: Jochen Schalanda <[email protected]> Co-authored-by: Roberto Selbach <[email protected]>
1 parent 2ddabca commit 58a029d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1761
-490
lines changed

.circleci/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040
key: go-mod-v1-{{ arch }}-{{ checksum "go.sum" }}
4141
paths:
4242
- "/go/pkg/mod"
43-
- run: go get github.com/mattn/goveralls
44-
- run: goveralls -service=circle-ci -coverprofile /tmp/coverage/combined.txt
4543

4644
"golang-1_16":
4745
<<: *template

.github/workflows/ci.yaml

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,30 @@ jobs:
99
name: lint
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/setup-go@v3
12+
- uses: actions/setup-go@v5
1313
with:
14-
go-version: "1.20.x"
15-
- uses: actions/checkout@v3
14+
go-version: "1.23.x"
15+
- uses: actions/checkout@v4
1616
- name: golangci-lint
17-
uses: golangci/golangci-lint-action@v3
17+
uses: golangci/golangci-lint-action@v6
1818
with:
1919
version: latest
2020

2121
test:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
go: ["1.19.x", "1.20.x"]
25+
go: ["1.22.x", "1.23.x"]
2626
steps:
27-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2828

29-
- uses: actions/setup-go@v3
29+
- uses: actions/setup-go@v5
3030
with:
3131
go-version: ${{ matrix.go }}
3232

3333
- name: Run test
3434
run: make test COVERAGE_DIR=/tmp/coverage
3535

36-
- name: Send goveralls coverage
37-
uses: shogo82148/actions-goveralls@v1
38-
with:
39-
path-to-profile: /tmp/coverage/combined.txt
40-
flag-name: Go-${{ matrix.go }}
41-
parallel: true
42-
43-
check-coverage:
44-
name: Check coverage
45-
needs: [test]
46-
runs-on: ubuntu-latest
47-
steps:
48-
- uses: shogo82148/actions-goveralls@v1
49-
with:
50-
parallel-finished: true
51-
5236
goreleaser:
5337
name: Release a new version
5438
needs: [lint, test]
@@ -60,30 +44,30 @@ jobs:
6044
# 3. When the workflow is triggered by a tag with `v` prefix
6145
if: ${{ success() && github.repository == 'golang-migrate/migrate' && startsWith(github.ref, 'refs/tags/v') }}
6246
steps:
63-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
6448
with:
6549
fetch-depth: 0
6650
- uses: ruby/setup-ruby@v1
6751
with:
6852
ruby-version: 2.7
69-
- uses: actions/setup-go@v3
53+
- uses: actions/setup-go@v5
7054
with:
71-
go-version: "1.19.x"
55+
go-version: "1.23.x"
7256

73-
- uses: docker/setup-qemu-action@v1
74-
- uses: docker/setup-buildx-action@v1
75-
- uses: docker/login-action@v1
57+
- uses: docker/setup-qemu-action@v3
58+
- uses: docker/setup-buildx-action@v3
59+
- uses: docker/login-action@v3
7660
with:
7761
username: golangmigrate
7862
password: ${{ secrets.DOCKERHUB_TOKEN }}
7963

8064
- run: echo "SOURCE=$(make echo-source)" >> $GITHUB_ENV
8165
- run: echo "DATABASE=$(make echo-database)" >> $GITHUB_ENV
8266

83-
- uses: goreleaser/goreleaser-action@v2
67+
- uses: goreleaser/goreleaser-action@v5
8468
with:
8569
version: latest
86-
args: release --rm-dist
70+
args: release --clean
8771
env:
8872
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8973

@@ -97,6 +81,9 @@ jobs:
9781
- run: package_cloud push golang-migrate/migrate/ubuntu/jammy dist/migrate.linux-amd64.deb
9882
env:
9983
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
84+
- run: package_cloud push golang-migrate/migrate/ubuntu/noble dist/migrate.linux-amd64.deb
85+
env:
86+
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
10087
- run: package_cloud push golang-migrate/migrate/debian/buster dist/migrate.linux-amd64.deb
10188
env:
10289
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ run:
44
linters:
55
enable:
66
#- golint
7-
- interfacer
7+
#- interfacer
88
- unconvert
99
#- dupl
1010
- goconst

.goreleaser.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ release:
8787
prerelease: auto
8888
source:
8989
enabled: true
90-
rlcp: true
9190
format: zip
9291
changelog:
9392
skip: false

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,11 @@ before_install:
3737
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.30.0
3838
- echo "TRAVIS_GO_VERSION=${TRAVIS_GO_VERSION}"
3939

40-
install:
41-
- go get github.com/mattn/goveralls
42-
4340
script:
4441
- golangci-lint run
4542
- make test COVERAGE_DIR=/tmp/coverage
4643

4744
after_success:
48-
- goveralls -service=travis-ci -coverprofile /tmp/coverage/combined.txt
4945
- make list-external-deps > dependency_tree.txt && cat dependency_tree.txt
5046
- make build-cli
5147
- gem install --no-document fpm

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-alpine3.18 AS builder
1+
FROM golang:1.23-alpine3.20 AS builder
22
ARG VERSION
33

44
RUN apk add --no-cache git gcc musl-dev make
@@ -15,7 +15,7 @@ COPY . ./
1515

1616
RUN make build-docker
1717

18-
FROM alpine:3.18
18+
FROM alpine:3.20
1919

2020
RUN apk add --no-cache ca-certificates
2121

Dockerfile.github-actions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.18
1+
FROM alpine:3.19
22

33
RUN apk add --no-cache ca-certificates
44

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
and whenever we want, not just once at the beginning of all tests.
5151

5252
#### Can I maintain my driver in my own repository?
53-
Yes, technically thats possible. We want to encourage you to contribute your driver to this respository though.
53+
Yes, technically thats possible. We want to encourage you to contribute your driver to this repository though.
5454
The driver's functionality is dictated by migrate's interfaces. That means there should really
5555
just be one driver for a database/ source. We want to prevent a future where several drivers doing the exact same thing,
5656
just implemented a bit differently, co-exist somewhere on GitHub. If users have to do research first to find the

GETTING_STARTED.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ migrate -database YOUR_DATABASE_URL -path PATH_TO_YOUR_MIGRATIONS up
2828

2929
Just add the code to your app and you're ready to go!
3030

31-
Before commiting your migrations you should run your migrations up, down, and then up again to see if migrations are working properly both ways.
31+
Before committing your migrations you should run your migrations up, down, and then up again to see if migrations are working properly both ways.
3232
(e.g. if you created a table in a migration but reverse migration did not delete it, you will encounter an error when running the forward migration again)
3333
It's also worth checking your migrations in a separate, containerized environment. You can find some tools at the [end of this document](#further-reading).
3434

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
SOURCE ?= file go_bindata github github_ee bitbucket aws_s3 google_cloud_storage godoc_vfs gitlab
2-
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5
2+
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite duckdb
33
DATABASE_TEST ?= $(DATABASE) sqlite sqlite3 sqlcipher
44
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
55
TEST_FLAGS ?=
66
REPO_OWNER ?= $(shell cd .. && basename "$$(pwd)")
77
COVERAGE_DIR ?= .coverage
88

99
build:
10-
CGO_ENABLED=0 go build -ldflags='-X main.Version=$(VERSION)' -tags '$(DATABASE) $(SOURCE)' ./cmd/migrate
10+
CGO_ENABLED=1 go build -ldflags='-X main.Version=$(VERSION)' -tags '$(DATABASE) $(SOURCE)' ./cmd/migrate
1111

1212
build-docker:
13-
CGO_ENABLED=0 go build -a -o build/migrate.linux-386 -ldflags="-s -w -X main.Version=${VERSION}" -tags "$(DATABASE) $(SOURCE)" ./cmd/migrate
13+
CGO_ENABLED=1 go build -a -o build/migrate.linux-386 -ldflags="-s -w -X main.Version=${VERSION}" -tags "$(DATABASE) $(SOURCE)" ./cmd/migrate
1414

1515
build-cli: clean
1616
-mkdir ./cli/build
17-
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o ../../cli/build/migrate.linux-amd64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
18-
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -a -o ../../cli/build/migrate.linux-armv7 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
19-
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -o ../../cli/build/migrate.linux-arm64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
20-
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -a -o ../../cli/build/migrate.darwin-amd64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
21-
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -a -o ../../cli/build/migrate.windows-386.exe -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
22-
cd ./cmd/migrate && CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -o ../../cli/build/migrate.windows-amd64.exe -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
17+
cd ./cmd/migrate && CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -o ../../cli/build/migrate.linux-amd64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
18+
cd ./cmd/migrate && CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 go build -a -o ../../cli/build/migrate.linux-armv7 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
19+
cd ./cmd/migrate && CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -a -o ../../cli/build/migrate.linux-arm64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
20+
cd ./cmd/migrate && CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -a -o ../../cli/build/migrate.darwin-amd64 -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
21+
cd ./cmd/migrate && CGO_ENABLED=1 GOOS=windows GOARCH=386 go build -a -o ../../cli/build/migrate.windows-386.exe -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
22+
cd ./cmd/migrate && CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -a -o ../../cli/build/migrate.windows-amd64.exe -ldflags='-X main.Version=$(VERSION) -extldflags "-static"' -tags '$(DATABASE) $(SOURCE)' .
2323
cd ./cli/build && find . -name 'migrate*' | xargs -I{} tar czf {}.tar.gz {}
2424
cd ./cli/build && shasum -a 256 * > sha256sum.txt
2525
cat ./cli/build/sha256sum.txt

0 commit comments

Comments
 (0)