
Really this directory exists to support the Gerrit1 -> 2 upgrade, and not as utilities for development. Signed-off-by: Shawn O. Pearce <sop@google.com>
26 lines
539 B
Bash
Executable File
26 lines
539 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# This script assumes the Gerrit1 import has already been
|
|
# renamed to 'gerrit1' schema:
|
|
#
|
|
# psql -c 'ALTER SCHEMA public RENAME TO gerrit1' $src
|
|
#
|
|
|
|
src=android_codereview
|
|
tmp=safedump
|
|
N="N.$$.sql"
|
|
|
|
dropdb $tmp
|
|
createdb -E UTF-8 $tmp &&
|
|
pg_dump -O -Fc $src >$N &&
|
|
pg_restore -d $tmp $N &&
|
|
psql -c 'UPDATE gerrit1.accounts SET
|
|
mailing_address = NULL
|
|
,mailing_address_country = NULL
|
|
,phone_number = NULL
|
|
,fax_number = NULL
|
|
,cla_comments = NULL' $tmp &&
|
|
pg_dump -O -Fc $tmp | bzip2 -9 >gerrit1.dump.bz2
|
|
dropdb $tmp
|
|
rm -f $N
|