refactor(document): move document domain core to document/ package
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
scripts/reset-db.sh
Executable file
26
scripts/reset-db.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
CONTAINER="archive-db"
|
||||
DB_USER="archive_user"
|
||||
DB_NAME="family_archive_db"
|
||||
|
||||
echo "This will delete ALL documents, persons, and tags from the database."
|
||||
read -rp "Type 'yes' to continue: " CONFIRM
|
||||
[ "$CONFIRM" != "yes" ] && echo "Aborted." && exit 0
|
||||
|
||||
docker exec "$CONTAINER" psql -U "$DB_USER" -d "$DB_NAME" -c "
|
||||
TRUNCATE transcription_block_versions CASCADE;
|
||||
TRUNCATE transcription_blocks CASCADE;
|
||||
TRUNCATE comment_mentions CASCADE;
|
||||
TRUNCATE document_comments CASCADE;
|
||||
TRUNCATE document_annotations CASCADE;
|
||||
TRUNCATE document_versions CASCADE;
|
||||
TRUNCATE notifications CASCADE;
|
||||
TRUNCATE documents CASCADE;
|
||||
TRUNCATE person_name_aliases CASCADE;
|
||||
TRUNCATE persons CASCADE;
|
||||
TRUNCATE tag CASCADE;
|
||||
" --quiet
|
||||
|
||||
echo "Done. Database is clean."
|
||||
Reference in New Issue
Block a user