be1389420b
* SQL format checking, 1. * SQL format checking, 2. * SQL format checking, 3. * SQL format checking, 4. * SQL format checking, 5. * Running pg_format * Getting rid of comment. * Upping pg_format version. * Using git ls-files for sql format check. * Fixing sql lints. * Addressing PR comments.
15 lines
311 B
Bash
Executable file
15 lines
311 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# This check is only used for CI.
|
|
|
|
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
|
|
|
cd $CWD/../
|
|
|
|
find migrations -type f -name "*.sql" -print0 | while read -d $'\0' FILE
|
|
do
|
|
TMP_FILE="/tmp/tmp_pg_format.sql"
|
|
pg_format $FILE > $TMP_FILE
|
|
diff $FILE $TMP_FILE
|
|
done
|