Skip to content

Commit 49e0abb

Browse files
fix(fixtures): issue-16447 seed requires an explicit disposable-database marker
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 366ec74 commit 49e0abb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎scripts/fixtures/issue-16447.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
Requires an already migrated .t3/userdata/statev2.sqlite. Removes copied project
66
and conversation projections so no private sidebar/history appears in evidence.
77
Does not change events or claim backend behavior. Never targets live T3 home.
8+
9+
Deletes every projection table, so it refuses to touch the database until you
10+
mark it disposable yourself, after copying in data you can lose:
11+
echo issue-16447-disposable > .t3/userdata/statev2.sqlite.issue-16447-disposable
812
"""
913
import datetime
1014
import json
@@ -15,6 +19,9 @@
1519
db = root / '.t3/userdata/statev2.sqlite'
1620
if not (root / '.git').exists() or not db.exists() or db.resolve() == Path.home() / '.t3/userdata/statev2.sqlite':
1721
raise SystemExit('Run in the isolated, migrated worktree only')
22+
marker = db.with_name(db.name + '.issue-16447-disposable')
23+
if not marker.is_file() or marker.read_text().strip() != 'issue-16447-disposable':
24+
raise SystemExit(f'Refusing to delete projections: create {marker} as described in this script\'s docstring')
1825
fixture = json.loads(Path(__file__).with_suffix('.json').read_text())
1926
c = sqlite3.connect(db)
2027
c.execute('PRAGMA foreign_keys=OFF')

0 commit comments

Comments
 (0)