mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
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.
16 lines
311 B
Bash
Executable File
16 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
|