Skip to content

Commit 5e50f8b

Browse files
committed
chore: debug apply
1 parent 6499d74 commit 5e50f8b

File tree

4 files changed

+42
-8
lines changed

4 files changed

+42
-8
lines changed

.github/workflows/pgschema-multifile-apply.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ jobs:
5555
id: apply
5656
run: |
5757
echo "::group::Applying schema changes"
58-
58+
echo "Running pgschema apply with detailed logging..."
59+
60+
# Enable detailed error reporting
61+
set -x # Show commands as they execute
62+
5963
# Run pgschema apply with auto-approve
6064
APPLY_OUTPUT=$(pgschema apply \
6165
--auto-approve \
@@ -67,11 +71,14 @@ jobs:
6771
--file "${{ github.workspace }}/multifile/main.sql" \
6872
--lock-timeout "30s" \
6973
--application-name "pgschema-github-action-apply" \
70-
--format human 2>&1)
74+
2>&1)
7175
7276
APPLY_EXIT_CODE=$?
77+
78+
set +x # Disable command tracing
7379
74-
# Output the results
80+
echo "Apply exit code: $APPLY_EXIT_CODE"
81+
echo "Apply output:"
7582
echo "$APPLY_OUTPUT"
7683
7784
echo "::endgroup::"

.github/workflows/pgschema-multifile-plan.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,21 @@ jobs:
5454
- name: Run pgschema plan
5555
id: plan
5656
run: |
57+
echo "Running pgschema plan with detailed logging..."
58+
59+
# Enable detailed error reporting
60+
set -x # Show commands as they execute
61+
5762
# Run pgschema plan
5863
PLAN_OUTPUT=$(pgschema plan \
5964
--host localhost \
6065
--port 5432 \
6166
--db testdb \
6267
--user postgres \
6368
--file "${{ github.workspace }}/multifile/main.sql" \
64-
--format human 2>&1)
69+
2>&1)
70+
71+
set +x # Disable command tracing
6572
6673
# Set output
6774
echo "plan<<EOF" >> $GITHUB_OUTPUT

.github/workflows/pgschema-singlefile-apply.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ jobs:
5555
id: apply
5656
run: |
5757
echo "::group::Applying schema changes"
58-
58+
echo "Running pgschema apply with detailed logging..."
59+
60+
# Enable detailed error reporting
61+
set -x # Show commands as they execute
62+
5963
# Run pgschema apply with auto-approve
6064
APPLY_OUTPUT=$(pgschema apply \
6165
--auto-approve \
@@ -67,11 +71,14 @@ jobs:
6771
--file "${{ github.workspace }}/singlefile/schema.sql" \
6872
--lock-timeout "30s" \
6973
--application-name "pgschema-github-action-apply" \
70-
--format human 2>&1)
74+
2>&1)
7175
7276
APPLY_EXIT_CODE=$?
77+
78+
set +x # Disable command tracing
7379
74-
# Output the results
80+
echo "Apply exit code: $APPLY_EXIT_CODE"
81+
echo "Apply output:"
7582
echo "$APPLY_OUTPUT"
7683
7784
echo "::endgroup::"
@@ -83,6 +90,7 @@ jobs:
8390
8491
echo "exit_code=$APPLY_EXIT_CODE" >> $GITHUB_OUTPUT
8592
93+
8694
# Exit with the same code as pgschema
8795
exit $APPLY_EXIT_CODE
8896
@@ -101,3 +109,8 @@ jobs:
101109
echo "❌ Failed to apply schema changes!"
102110
echo ""
103111
echo "Please check the logs above for details."
112+
echo "Common issues:"
113+
echo "- Schema syntax errors"
114+
echo "- Database connection issues"
115+
echo "- Lock timeout exceeded"
116+
echo "- Incompatible schema changes"

.github/workflows/pgschema-singlefile-plan.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ jobs:
5454
- name: Run pgschema plan
5555
id: plan
5656
run: |
57+
echo "Running pgschema plan with detailed logging..."
58+
59+
# Enable detailed error reporting
60+
set -x # Show commands as they execute
61+
5762
# Run pgschema plan
5863
PLAN_OUTPUT=$(pgschema plan \
5964
--debug \
@@ -62,7 +67,9 @@ jobs:
6267
--db testdb \
6368
--user postgres \
6469
--file "${{ github.workspace }}/singlefile/schema.sql" \
65-
--format human 2>&1)
70+
2>&1)
71+
72+
set +x # Disable command tracing
6673
6774
# Set output
6875
echo "plan<<EOF" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)