diff --git a/.github/workflows/pgschema-multifile-apply.yml b/.github/workflows/pgschema-multifile-apply.yml index b10c972..746fcf9 100644 --- a/.github/workflows/pgschema-multifile-apply.yml +++ b/.github/workflows/pgschema-multifile-apply.yml @@ -46,7 +46,7 @@ jobs: go-version: "stable" - name: Install pgschema - run: go install github.com/pgschema/pgschema@latest + run: go install github.com/pgplex/pgschema@latest - name: Download plan.json artifact uses: dawidd6/action-download-artifact@v6 @@ -62,7 +62,7 @@ jobs: echo "❌ Error: plan.json not found. Make sure the plan workflow completed successfully." exit 1 fi - + echo "✅ plan.json found and ready for apply" echo "Plan file size: $(stat -f%z plan.json 2>/dev/null || stat -c%s plan.json) bytes" @@ -77,10 +77,10 @@ jobs: run: | echo "::group::Applying schema changes using plan.json" echo "Running pgschema apply with pre-generated plan..." - + # Enable detailed error reporting set -x # Show commands as they execute - + # Run pgschema apply using the plan.json file APPLY_OUTPUT=$(pgschema apply \ --debug \ @@ -95,7 +95,7 @@ jobs: 2>&1) APPLY_EXIT_CODE=$? - + set +x # Disable command tracing echo "Apply exit code: $APPLY_EXIT_CODE" @@ -165,12 +165,12 @@ jobs: commentBody = `## ❌ Schema Migration Failed! The multi-file schema migration failed after merging this PR using plan \`pgschema-plan-${{ github.event.pull_request.number }}\`. - + This could indicate: - Database schema changed between plan and apply (fingerprint mismatch) - Invalid plan.json file - Database connectivity issues - + Please review the error details below:
diff --git a/.github/workflows/pgschema-multifile-plan.yml b/.github/workflows/pgschema-multifile-plan.yml index 20815ba..5890c1b 100644 --- a/.github/workflows/pgschema-multifile-plan.yml +++ b/.github/workflows/pgschema-multifile-plan.yml @@ -43,7 +43,7 @@ jobs: go-version: "stable" - name: Install pgschema - run: go install github.com/pgschema/pgschema@latest + run: go install github.com/pgplex/pgschema@latest - name: Load baseline schema run: | diff --git a/.github/workflows/pgschema-singlefile-apply.yml b/.github/workflows/pgschema-singlefile-apply.yml index 0cd4ae8..4bdcaf2 100644 --- a/.github/workflows/pgschema-singlefile-apply.yml +++ b/.github/workflows/pgschema-singlefile-apply.yml @@ -46,7 +46,7 @@ jobs: go-version: "stable" - name: Install pgschema - run: go install github.com/pgschema/pgschema@latest + run: go install github.com/pgplex/pgschema@latest - name: Download plan.json artifact uses: dawidd6/action-download-artifact@v6 @@ -62,7 +62,7 @@ jobs: echo "❌ Error: plan.json not found. Make sure the plan workflow completed successfully." exit 1 fi - + echo "✅ plan.json found and ready for apply" echo "Plan file size: $(stat -f%z plan.json 2>/dev/null || stat -c%s plan.json) bytes" @@ -165,12 +165,12 @@ jobs: commentBody = `## ❌ Schema Migration Failed! The single-file schema migration failed after merging this PR using plan \`pgschema-singlefile-plan-${{ github.event.pull_request.number }}\`. - + This could indicate: - Database schema changed between plan and apply (fingerprint mismatch) - Invalid plan.json file - Database connectivity issues - + Please review the error details below:
diff --git a/.github/workflows/pgschema-singlefile-plan.yml b/.github/workflows/pgschema-singlefile-plan.yml index 5f1f28e..a57e248 100644 --- a/.github/workflows/pgschema-singlefile-plan.yml +++ b/.github/workflows/pgschema-singlefile-plan.yml @@ -43,7 +43,7 @@ jobs: go-version: "stable" - name: Install pgschema - run: go install github.com/pgschema/pgschema@latest + run: go install github.com/pgplex/pgschema@latest - name: Load baseline schema run: | diff --git a/multifile/tables/orders.sql b/multifile/tables/orders.sql index d29d4a7..ffcf623 100644 --- a/multifile/tables/orders.sql +++ b/multifile/tables/orders.sql @@ -5,8 +5,7 @@ CREATE TABLE IF NOT EXISTS orders ( id integer PRIMARY KEY, user_id integer NOT NULL REFERENCES users(id), - status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed')), - amount numeric(10,2) DEFAULT 0.00 + status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed')) ); COMMENT ON TABLE orders IS 'Customer orders'; diff --git a/multifile/tables/users.sql b/multifile/tables/users.sql index 4c4a595..7adde68 100644 --- a/multifile/tables/users.sql +++ b/multifile/tables/users.sql @@ -5,7 +5,8 @@ CREATE TABLE IF NOT EXISTS users ( id integer PRIMARY KEY, email text NOT NULL CHECK (email LIKE '%@%'), - name text NOT NULL + name text NOT NULL, + age integer CHECK (age >= 0) ); COMMENT ON TABLE users IS 'User accounts';