main pico / runbooks / delete-account.md
Eric Bower  ·  2026-08-01
 1# How to delete user with all data
 2
 3Log into production db, then drop into psql
 4
 5```bash
 6cd pico
 7make psql
 8```
 9
10```sql
11delete from app_users where name = 'xxx';
12```
13
14This only removes data from the database, we also have static assets (prose images, pgs assets).
15
16We have a clean bucket script for prose and pgs that we run periodically to remove static assets from orphaned buckets.
17
18SSH into pgs or prose VMs then run:
19
20```bash
21make scripts
22FS_STORAGE_DIR="./data/storage" go run ./cmd/scripts/clean-buckets
23```
24
25Finally, wipe the pgs cache so any sites that were deleted are actually removed:
26
27```bash
28ssh pgs.sh cache-all
29```