mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
Scripts: Add script for resetting postgres sequences for imports.
This commit is contained in:
5
scripts/setup/postgres-reset-sequences
Executable file
5
scripts/setup/postgres-reset-sequences
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
./manage.py sqlsequencereset zerver | ./manage.py dbshell
|
||||
echo "Sequence has been reset successfully!"
|
||||
@@ -72,3 +72,7 @@ import a database dump from one or more JSON files."""
|
||||
|
||||
print("Processing dump: %s ..." % (path,))
|
||||
do_import_realm(path)
|
||||
if options["destroy_rebuild_database"]:
|
||||
print("Resetting auto-increment sequence for Postgres......")
|
||||
subprocess.check_call([os.path.join(settings.DEPLOY_ROOT,
|
||||
"scripts/setup/postgres-reset-sequences")])
|
||||
|
||||
Reference in New Issue
Block a user