Commit 5249bcf
committed
fix: add base-case CREATE TABLE for balances in _ensure_schema
On a fresh empty SQLite database, _ensure_schema() assumed the balances
table already existed. It would immediately fail at PRAGMA table_info(balances)
and then attempt ALTER TABLE balances on a non-existent table, causing
sqlite3.OperationalError: no such table: balances across all 15 tests in
test_tx_handler_limits.py.
Add CREATE TABLE IF NOT EXISTS balances as the first step so _ensure_schema()
is idempotent on both fresh and migrated databases.1 parent 8cf462f commit 5249bcf
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
| |||
0 commit comments