Revert "order seed-badges.sql by badge id"

This reverts commit 108a4e2929.
master
Aevann 2023-11-04 19:13:06 +02:00
parent 6a5d9753e8
commit 1eca90b4f1
1 changed files with 1 additions and 7 deletions

View File

@ -5,13 +5,7 @@
pg_dump -O -x --schema-only "$DATABASE_URL" > '/d/schema.sql' pg_dump -O -x --schema-only "$DATABASE_URL" > '/d/schema.sql'
#generate seed-badges.sql #generate seed-badges.sql
EXPORT_BADGES=$(psql --csv --tuples-only -P "null=NULL" -c \ pg_dump -O -x --data-only --inserts -t 'badge_defs' "$DATABASE_URL" > "/d/seed-badges.sql"
"SELECT ''||id||'', ' '''||name||'''', ' '''||description||'''', ' '||created_utc||'' FROM badge_defs ORDER BY id" \
"$DATABASE_URL")
EXPORT_BADGES=$(sed 's/.*/\(&\),/' <<< "$EXPORT_BADGES")
echo "INSERT INTO public.badge_defs VALUES" > "/d/seed-badges.sql"
echo "${EXPORT_BADGES%?}" >> "/d/seed-badges.sql"
echo "ON CONFLICT (id) DO nothing;" >> "/d/seed-badges.sql"
#generate seed-hats.sql #generate seed-hats.sql
pg_dump -O -x --data-only --inserts -t 'hat_defs' "$DATABASE_URL" > "/d/seed-hats.sql" pg_dump -O -x --data-only --inserts -t 'hat_defs' "$DATABASE_URL" > "/d/seed-hats.sql"