Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.6.2
version: v2.11.4

test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:

- uses: goreleaser/goreleaser-action@v5
with:
version: latest
version: v1.26.2
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Validate release configuration

on:
pull_request:
paths:
- ".goreleaser.yml"
- "Dockerfile.github-actions"
- "go.mod"
- "go.sum"
- ".github/workflows/ci.yaml"
- ".github/workflows/release-check.yaml"

permissions:
contents: read

jobs:
snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: actions/setup-go@v5
with:
go-version: "1.26.x"

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

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

- uses: goreleaser/goreleaser-action@v5
with:
version: v1.26.2
args: release --snapshot --skip-publish --clean
7 changes: 7 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ builds:
- 386
goarm:
- 7
ignore:
- goos: windows
goarch: arm
- goos: darwin
goarch: arm
- goos: darwin
goarch: 386
main: ./cmd/migrate
ldflags:
- '-w -s -X main.Version={{ .Version }} -extldflags "static"'
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.26.4-alpine AS builder
FROM golang:1.26.8-alpine3.24 AS builder
ARG VERSION

RUN apk add --no-cache git gcc musl-dev make
Expand All @@ -21,5 +21,5 @@ COPY --from=builder /go/src/github.com/infobloxopen/migrate/cmd/migrate/config /
COPY --from=builder /go/src/github.com/infobloxopen/migrate/build/migrate.linux-386 /migrate
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs/

ENTRYPOINT ["migrate"]
ENTRYPOINT ["/migrate"]
CMD ["--help"]
5 changes: 3 additions & 2 deletions Dockerfile.github-actions
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM alpine:latest
FROM alpine:3.24

RUN apk add --no-cache ca-certificates
RUN apk upgrade --no-cache \
&& apk add --no-cache ca-certificates

COPY migrate /usr/local/bin/migrate

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Coverage Status](https://img.shields.io/coveralls/github/golang-migrate/migrate/master.svg)](https://coveralls.io/github/golang-migrate/migrate?branch=master)
[![packagecloud.io](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/golang-migrate/migrate?filter=debs)
[![Docker Pulls](https://img.shields.io/docker/pulls/migrate/migrate.svg)](https://hub.docker.com/r/migrate/migrate/)
![Supported Go Versions](https://img.shields.io/badge/Go-1.25-lightgrey.svg)
![Supported Go Versions](https://img.shields.io/badge/Go-1.26-lightgrey.svg)
[![GitHub Release](https://img.shields.io/github/release/golang-migrate/migrate.svg)](https://github.com/golang-migrate/migrate/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/golang-migrate/migrate/v4)](https://goreportcard.com/report/github.com/golang-migrate/migrate/v4)

Expand Down
7 changes: 1 addition & 6 deletions database/mongodb/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,7 @@ func waitForReplicaInit(client *mongo.Client) error {
//during replica set initialization, the first node first becomes a secondary and then becomes the primary
//should consider that initialization is completed only after the node has become the primary
result := client.Database("admin").RunCommand(context.TODO(), bson.D{bson.E{Key: "isMaster", Value: 1}})
r, err := result.DecodeBytes()
if err != nil {
return err
}
err = bson.Unmarshal(r, &status)
if err != nil {
if err := result.Decode(&status); err != nil {
return err
}
if status.IsMaster {
Expand Down
2 changes: 1 addition & 1 deletion database/pgx/pgx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ var (
PortRequired: true, ReadyFunc: isReady}
// Supported versions: https://www.postgresql.org/support/versioning/
specs = []dktesting.ContainerSpec{
{ImageName: "postgres:13", Options: opts},
{ImageName: "postgres:14", Options: opts},
{ImageName: "postgres:15", Options: opts},
{ImageName: "postgres:16", Options: opts},
{ImageName: "postgres:17", Options: opts},
{ImageName: "postgres:18", Options: opts},
}
)

Expand Down
2 changes: 1 addition & 1 deletion database/pgx/v5/pgx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ var (
PortRequired: true, ReadyFunc: isReady}
// Supported versions: https://www.postgresql.org/support/versioning/
specs = []dktesting.ContainerSpec{
{ImageName: "postgres:13", Options: opts},
{ImageName: "postgres:14", Options: opts},
{ImageName: "postgres:15", Options: opts},
{ImageName: "postgres:16", Options: opts},
{ImageName: "postgres:17", Options: opts},
{ImageName: "postgres:18", Options: opts},
}
)

Expand Down
2 changes: 1 addition & 1 deletion database/postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ var (
PortRequired: true, ReadyFunc: isReady}
// Supported versions: https://www.postgresql.org/support/versioning/
specs = []dktesting.ContainerSpec{
{ImageName: "postgres:13", Options: opts},
{ImageName: "postgres:14", Options: opts},
{ImageName: "postgres:15", Options: opts},
{ImageName: "postgres:16", Options: opts},
{ImageName: "postgres:17", Options: opts},
{ImageName: "postgres:18", Options: opts},
}
)

Expand Down
5 changes: 5 additions & 0 deletions database/spanner/spanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ func TestCleanStatements(t *testing.T) {
multiStatement: "CREATE TABLE table_name (id STRING(255) NOT NULL) PRIMARY KEY (id);",
expected: []string{"CREATE TABLE table_name (\n id STRING(255) NOT NULL,\n) PRIMARY KEY(id)"},
},
{
name: "can clean uuid column types",
multiStatement: "CREATE TABLE table_name (id uuid NOT NULL) PRIMARY KEY (id);",
expected: []string{"CREATE TABLE table_name (\n id UUID NOT NULL,\n) PRIMARY KEY(id)"},
},
{
name: "single statement, multi line, with semicolon, no comment",
multiStatement: `CREATE TABLE table_name (
Expand Down
1 change: 1 addition & 0 deletions database/sqlserver/sqlserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
}
// Container versions: https://mcr.microsoft.com/v2/mssql/server/tags/list
specs = []dktesting.ContainerSpec{
{ImageName: "mcr.microsoft.com/mssql/server:2025-latest", Options: sqlServerOpts},
{ImageName: "mcr.microsoft.com/mssql/server:2022-latest", Options: sqlServerOpts},
{ImageName: "mcr.microsoft.com/mssql/server:2019-latest", Options: sqlServerOpts},
// Add back support for 2017 version once the image is fixed: https://github.com/microsoft/mssql-docker/issues/899
Expand Down
8 changes: 5 additions & 3 deletions database/yugabytedb/yugabytedb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ var (
ReadyFunc: isReady,
Timeout: time.Duration(60) * time.Second,
}
// Released versions: https://docs.yugabyte.com/preview/releases/release-notes/
// Released versions: https://docs.yugabyte.com/stable/releases/ybdb-releases/
specs = []dktesting.ContainerSpec{
{ImageName: "yugabytedb/yugabyte:2.14.15.0-b57", Options: opts},
{ImageName: "yugabytedb/yugabyte:2.20.2.1-b3", Options: opts},
{ImageName: "yugabytedb/yugabyte:2025.2.2.2-b11", Options: opts},
{ImageName: "yugabytedb/yugabyte:2025.1.4.0-b103", Options: opts},
{ImageName: "yugabytedb/yugabyte:2024.2.9.0-b55", Options: opts},
{ImageName: "yugabytedb/yugabyte:2.20.12.0-b30", Options: opts},
}
)

Expand Down
11 changes: 7 additions & 4 deletions dktesting/dktesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"testing"

"github.com/containerd/errdefs"
"github.com/dhui/dktest"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/client"
"github.com/moby/moby/client"
)

// ContainerSpec holds Docker testing setup specifications
Expand All @@ -19,7 +19,7 @@ type ContainerSpec struct {
// Cleanup cleanups the ContainerSpec after a test run by removing the ContainerSpec's image
func (s *ContainerSpec) Cleanup() (retErr error) {
// copied from dktest.RunContext()
dc, err := client.NewClientWithOpts(client.FromEnv, client.WithVersion("1.41"))
dc, err := client.New(client.FromEnv, client.WithAPIVersion("1.41"))
if err != nil {
return err
}
Expand All @@ -34,7 +34,10 @@ func (s *ContainerSpec) Cleanup() (retErr error) {
}
ctx, timeoutCancelFunc := context.WithTimeout(context.Background(), cleanupTimeout)
defer timeoutCancelFunc()
if _, err := dc.ImageRemove(ctx, s.ImageName, image.RemoveOptions{Force: true, PruneChildren: true}); err != nil {
if _, err := dc.ImageRemove(ctx, s.ImageName, client.ImageRemoveOptions{Force: true, PruneChildren: true}); err != nil {
if errdefs.IsNotFound(err) {
return nil
}
return err
}
return nil
Expand Down
29 changes: 15 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/golang-migrate/migrate/v4
go 1.26.0

require (
cloud.google.com/go/spanner v1.88.0
cloud.google.com/go/spanner v1.92.0
cloud.google.com/go/storage v1.56.0
github.com/Azure/go-autorest/autorest/adal v0.9.16
github.com/ClickHouse/clickhouse-go v1.4.3
Expand All @@ -13,7 +13,7 @@ require (
github.com/cenkalti/backoff/v4 v4.1.2
github.com/cockroachdb/cockroach-go/v2 v2.1.1
github.com/dhui/dktest v0.4.6
github.com/docker/docker v28.3.3+incompatible
github.com/docker/docker v28.5.2+incompatible // indirect
github.com/fsouza/fake-gcs-server v1.17.0
github.com/go-sql-driver/mysql v1.5.0
github.com/gobuffalo/here v0.6.0
Expand Down Expand Up @@ -47,15 +47,14 @@ require (
cel.dev/expr v0.25.3 // indirect
cloud.google.com/go/auth v0.23.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
cloud.google.com/go/monitoring v1.24.3 // indirect
cloud.google.com/go/monitoring v1.29.0 // indirect
github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp v1.6.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.35.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-connections v0.7.0 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.39.0 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
Expand All @@ -67,7 +66,7 @@ require (
github.com/spiffe/go-spiffe/v2 v2.8.1 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.45.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0 // indirect
go.opentelemetry.io/otel v1.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.42.0 // indirect
Expand All @@ -82,20 +81,20 @@ require (
require (
cloud.google.com/go v0.123.0 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
cloud.google.com/go/iam v1.5.3 // indirect
cloud.google.com/go/longrunning v0.8.0 // indirect
cloud.google.com/go/iam v1.11.0 // indirect
cloud.google.com/go/longrunning v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.8.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/apache/thrift v0.22.0 // indirect
github.com/apache/thrift v0.24.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.41.5
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.14 // indirect
Expand All @@ -120,7 +119,6 @@ require (
github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.7 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/golang/snappy v1.0.0 // indirect
Expand All @@ -137,11 +135,11 @@ require (
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/image-spec v1.1.1 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
Expand All @@ -164,7 +162,7 @@ require (
golang.org/x/text v0.42.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect
google.golang.org/genproto v0.0.0-20260630182238-925bb5da69e7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260817212433-ac3dfec99bb1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd // indirect
google.golang.org/grpc v1.85.0-dev.0.20260825072537-93e31b48545e // indirect
Expand All @@ -189,6 +187,7 @@ require (

require (
github.com/aws/aws-sdk-go-v2/config v1.32.14
github.com/containerd/errdefs v1.0.0
github.com/hashicorp/go-multierror v1.1.1
github.com/spf13/pflag v1.0.10
github.com/spf13/viper v1.21.0
Expand Down Expand Up @@ -218,6 +217,8 @@ require (
github.com/klauspost/cpuid/v2 v2.2.11 // indirect
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
github.com/moby/moby/api v1.54.2
github.com/moby/moby/client v0.4.1
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
Expand Down
Loading
Loading