diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 44ab00748..475bc4950 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -18,7 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Run tests run: go test -v ./... diff --git a/.github/workflows/docker-latest.yml b/.github/workflows/docker-latest.yml index c7011b35c..3c8840581 100644 --- a/.github/workflows/docker-latest.yml +++ b/.github/workflows/docker-latest.yml @@ -41,7 +41,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Run integration tests run: go test -v ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 48b80bd10..16e9f8191 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Run tests (PostgreSQL ${{ matrix.pg-version }}) env: @@ -53,7 +53,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Read version id: version diff --git a/CLAUDE.md b/CLAUDE.md index 77f354aa7..5b3fb5f68 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -11,7 +11,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - **Plan**: Compare desired state with current database and generate migration plan - **Apply**: Execute the migration with safety features like concurrent change detection, transaction-adaptive execution, and lock timeout control -The tool is written in Go 1.24.0 (toolchain go1.24.7) and uses: +The tool is written in Go 1.25.0 and uses: - Cobra for CLI commands - embedded-postgres v1.33.0 for plan command (temporary instances) and testing (no Docker required) diff --git a/cmd/dump/dump_integration_test.go b/cmd/dump/dump_integration_test.go index 201b58210..56a03a3aa 100644 --- a/cmd/dump/dump_integration_test.go +++ b/cmd/dump/dump_integration_test.go @@ -660,6 +660,10 @@ var tzOffsetRe = regexp.MustCompile(`(\d{2}:\d{2}:\d{2})[-+]\d{2}(:\d{2})?`) // normalizeSchemaOutput removes version-specific lines and normalizes // timezone offsets in partition bounds for cross-platform comparison. func normalizeSchemaOutput(output string) string { + // Normalize CRLF to LF so checked-in fixtures that git converted to CRLF + // on checkout (e.g. Windows with core.autocrlf=true) compare equal to + // LF-only runtime output. + output = strings.ReplaceAll(output, "\r\n", "\n") lines := strings.Split(output, "\n") var normalizedLines []string diff --git a/cmd/include_integration_test.go b/cmd/include_integration_test.go index 43299caad..59afe0a2f 100644 --- a/cmd/include_integration_test.go +++ b/cmd/include_integration_test.go @@ -293,9 +293,15 @@ func compareFileContents(t *testing.T, sourceFilePath, dumpFilePath, displayName return } - if string(sourceContent) != string(dumpContent) { + // Normalize CRLF to LF so checked-in source fixtures that git converted to + // CRLF on checkout (e.g. Windows with core.autocrlf=true) compare equal to + // LF-only runtime dump output. + normalizedSource := strings.ReplaceAll(string(sourceContent), "\r\n", "\n") + normalizedDump := strings.ReplaceAll(string(dumpContent), "\r\n", "\n") + + if normalizedSource != normalizedDump { t.Errorf("Content mismatch for %s", displayName) - t.Logf("\n\nExpected:\n%s\n\n", string(sourceContent)) - t.Logf("\n\nActual:\n%s\n\n", string(dumpContent)) + t.Logf("\n\nExpected:\n%s\n\n", normalizedSource) + t.Logf("\n\nActual:\n%s\n\n", normalizedDump) } } diff --git a/docs/installation.mdx b/docs/installation.mdx index 20d6ad61f..70120986f 100644 --- a/docs/installation.mdx +++ b/docs/installation.mdx @@ -231,7 +231,7 @@ docker run --rm --network host \ ## Go Install -If you have Go 1.24.0 or later installed, you can install pgschema directly: +If you have Go 1.25.0 or later installed, you can install pgschema directly: ```bash go install github.com/pgplex/pgschema@latest @@ -262,4 +262,4 @@ go build -v -o pgschema . sudo mv pgschema /usr/local/bin/ ``` -Building from source requires Go 1.24.0 or later. \ No newline at end of file +Building from source requires Go 1.25.0 or later. \ No newline at end of file diff --git a/docs/workflow/gitops.mdx b/docs/workflow/gitops.mdx index 2251635b0..038212fce 100644 --- a/docs/workflow/gitops.mdx +++ b/docs/workflow/gitops.mdx @@ -125,7 +125,7 @@ The typical workflow follows a review-then-apply pattern that ensures all schema - uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.25' - name: Install pgschema run: go install github.com/pgplex/pgschema@latest @@ -212,7 +212,7 @@ The typical workflow follows a review-then-apply pattern that ensures all schema - uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.25' - name: Install pgschema run: go install github.com/pgplex/pgschema@latest @@ -290,7 +290,7 @@ variables: # Plan job - runs on merge requests and main branch pgschema-plan: stage: plan - image: golang:1.24 + image: golang:1.25 script: - go install github.com/pgplex/pgschema@latest - | @@ -331,7 +331,7 @@ pgschema-plan: # Apply job - manual trigger on main branch pgschema-apply: stage: apply - image: golang:1.24 + image: golang:1.25 needs: ["pgschema-plan"] dependencies: - pgschema-plan @@ -399,7 +399,7 @@ stages: steps: - task: GoTool@0 inputs: - version: '1.24' + version: '1.25' - script: | go install github.com/pgplex/pgschema@latest @@ -449,7 +449,7 @@ stages: steps: - task: GoTool@0 inputs: - version: '1.24' + version: '1.25' - script: | go install github.com/pgplex/pgschema@latest diff --git a/go.mod b/go.mod index 5e80741bf..925d43a62 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,16 @@ module github.com/pgplex/pgschema -go 1.24.0 - -toolchain go1.24.7 +go 1.25.0 require ( github.com/BurntSushi/toml v1.5.0 github.com/fergusstrange/embedded-postgres v1.33.0 github.com/google/go-cmp v0.7.0 - github.com/jackc/pgx/v5 v5.7.5 + github.com/jackc/pgx/v5 v5.9.2 github.com/joho/godotenv v1.5.1 github.com/lib/pq v1.10.9 github.com/spf13/cobra v1.9.1 - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.1 golang.org/x/sync v0.17.0 ) @@ -26,7 +24,6 @@ require ( github.com/rogpeppe/go-internal v1.14.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect - golang.org/x/crypto v0.37.0 // indirect - golang.org/x/text v0.24.0 // indirect + golang.org/x/text v0.29.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 25c5a9fd0..f847c6576 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsI github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs= -github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M= +github.com/jackc/pgx/v5 v5.9.2 h1:3ZhOzMWnR4yJ+RW1XImIPsD1aNSz4T4fyP7zlQb56hw= +github.com/jackc/pgx/v5 v5.9.2/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= @@ -38,18 +38,16 @@ github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= +golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/internal/diff/diff_test.go b/internal/diff/diff_test.go index f6e2a78c0..7965080ab 100644 --- a/internal/diff/diff_test.go +++ b/internal/diff/diff_test.go @@ -232,8 +232,10 @@ func normalizeSQL(sql string) string { var normalizedLines []string for _, line := range lines { - // Preserve leading whitespace (indentation) but trim trailing whitespace - trimmed := strings.TrimRight(line, " \t") + // Preserve leading whitespace (indentation) but trim trailing whitespace. + // Includes \r so CRLF fixtures (e.g. checked out on Windows with + // core.autocrlf=true) compare equal to LF-only runtime output. + trimmed := strings.TrimRight(line, " \t\r") if trimmed != "" { normalizedLines = append(normalizedLines, trimmed) } diff --git a/ir/README.md b/ir/README.md index 42752e9c4..bb1ec1cb0 100644 --- a/ir/README.md +++ b/ir/README.md @@ -150,7 +150,7 @@ go test -short -v ./... ## Compatibility -- **Go**: 1.24.0+ +- **Go**: 1.25.0+ - **PostgreSQL**: 14, 15, 16, 17, 18 ## License diff --git a/nix/pgschema.nix b/nix/pgschema.nix index 766070ff4..839f449fb 100644 --- a/nix/pgschema.nix +++ b/nix/pgschema.nix @@ -10,8 +10,8 @@ pkgs.buildGoModule { inherit version; src = lib.cleanSource ../.; - # Prefer Go 1.24 when available; fall back to the closest newer toolchain. - go = if pkgs ? go_1_24 then pkgs.go_1_24 else pkgs.go_1_25; + # Prefer Go 1.25 when available; fall back to the closest newer toolchain. + go = if pkgs ? go_1_25 then pkgs.go_1_25 else pkgs.go_1_26; subPackages = [ "." ]; proxyVendor = true; # buildGoModule runs `go test ./...` by default; disable checks because