Skip to content

Commit 8822670

Browse files
committed
script improvs
1 parent 677723d commit 8822670

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import sys
22
import re
33

4-
EXCLUDED_PREFIXES = ('SET ', 'SELECT ', 'GRANT ', 'REVOKE ', '\\')
5-
64

75
def filter_lines(text):
86
"""Remove irrelevant lines from the schema dump"""
7+
excluded_prefixes = ('SET ', 'SELECT ', 'GRANT ', 'REVOKE ', '\\')
98
lines = [
109
line for line in text.splitlines(keepends=True)
11-
if line.strip() and not line.startswith(EXCLUDED_PREFIXES)
10+
if line.strip() and not line.startswith(excluded_prefixes)
1211
]
1312
return ''.join(lines)
1413

.github/workflows/database.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ jobs:
179179
run: |
180180
pg_dump -U dirigent -h localhost dirigent \
181181
--schema-only --no-comments --no-privileges --no-owner \
182-
| python3 .github/scripts/normalize-psql-schema.py \
182+
| python3 .github/scripts/normalize-psql-dump.py \
183183
> /tmp/schema_baseline.sql
184184
pg_dump -U dirigent -h localhost dirigent \
185185
--data-only --no-comments --no-privileges --no-owner \
186-
| python3 .github/scripts/normalize-psql-schema.py \
186+
| python3 .github/scripts/normalize-psql-dump.py \
187187
> /tmp/data_baseline.sql
188188
189189
- name: Install Composer dependencies for current branch
@@ -205,11 +205,11 @@ jobs:
205205
run: |
206206
pg_dump -U dirigent -h localhost dirigent \
207207
--schema-only --no-comments --no-privileges --no-owner \
208-
| python3 .github/scripts/normalize-psql-schema.py \
208+
| python3 .github/scripts/normalize-psql-dump.py \
209209
> /tmp/schema_reverted.sql
210210
pg_dump -U dirigent -h localhost dirigent \
211211
--data-only --no-comments --no-privileges --no-owner \
212-
| python3 .github/scripts/normalize-psql-schema.py \
212+
| python3 .github/scripts/normalize-psql-dump.py \
213213
> /tmp/data_reverted.sql
214214
215215
- name: Verify schema after revert matches baseline

0 commit comments

Comments
 (0)