-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch_firestore.py
More file actions
36 lines (29 loc) · 965 Bytes
/
Copy pathpatch_firestore.py
File metadata and controls
36 lines (29 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys, os
sys.path.insert(0, r'C:\dev\litt\backend')
os.chdir(r'C:\dev\litt\backend')
os.environ.setdefault('LITT_DEMO_MODE', 'true')
os.environ.setdefault('LITT_DEMO_FIRM_ID', 'strand-okafor')
from app.db import get_db
FIRM_ID = 'strand-okafor'
def col(db, name):
return db.collection('firms').document(FIRM_ID).collection(name)
db = get_db()
extra_escalations = ['esc-seed-003', 'esc-seed-004', 'esc-seed-005']
for eid in extra_escalations:
ref = col(db, 'escalations').document(eid)
doc = ref.get()
if doc.exists:
ref.delete()
print(f'Deleted escalation {eid}')
else:
print(f' {eid} not found (ok)')
extra_inbox = ['inbound-acme-billing', 'inbound-opp-counsel-001']
for iid in extra_inbox:
ref = col(db, 'inbound_messages').document(iid)
doc = ref.get()
if doc.exists:
ref.delete()
print(f'Deleted inbox {iid}')
else:
print(f' {iid} not found (ok)')
print('Done')