diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bda86b1..57b1562 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,8 +57,26 @@ jobs: fi done + type-generation: + name: type generation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Generate types + run: | + make generate + + - name: Ensure generated types are up-to-date + run: | + if ! git diff --quiet; then + echo "generated types are out of date!" + echo "run 'make generate' to regenerate type definitions" + exit 1 + fi + license-check: - name: License check + name: license check runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -106,7 +124,7 @@ jobs: release: runs-on: ubuntu-latest - needs: [test, lint, examples, license-check] + needs: [test, lint, examples, license-check, type-generation] if: startsWith(github.ref, 'refs/tags/') env: DOCKER_CLI_EXPERIMENTAL: "enabled" diff --git a/pkg/migrations/types.go b/pkg/migrations/types.go index 106d45a..4d4214e 100644 --- a/pkg/migrations/types.go +++ b/pkg/migrations/types.go @@ -192,9 +192,13 @@ type PgRollMigration struct { Name string `json:"name"` // Operations corresponds to the JSON schema field "operations". - Operations []interface{} `json:"operations"` + Operations PgRollOperations `json:"operations"` } +type PgRollOperation interface{} + +type PgRollOperations []interface{} + // Replica identity definition type ReplicaIdentity struct { // Name of the index to use as replica identity