Test old database upgrades work (STRICT not applied during migrations).
(node_factory, bitcoind)
| 681 | @unittest.skipIf(not COMPAT, "needs COMPAT to test old database upgrade") |
| 682 | @unittest.skipIf(TEST_NETWORK != 'regtest', "The network must match the DB snapshot") |
| 683 | def test_strict_mode_with_old_database(node_factory, bitcoind): |
| 684 | """Test old database upgrades work (STRICT not applied during migrations).""" |
| 685 | bitcoind.generate_block(1) |
| 686 | |
| 687 | l1 = node_factory.get_node(dbfile='oldstyle-scids.sqlite3.xz', |
| 688 | options={'database-upgrade': True, |
| 689 | 'developer': None}) |
| 690 | |
| 691 | assert l1.rpc.getinfo()['id'] is not None |
| 692 | |
| 693 | strict_tables = l1.db_query( |
| 694 | "SELECT name FROM sqlite_master " |
| 695 | "WHERE type='table' AND sql LIKE '%STRICT%'" |
| 696 | ) |
| 697 | assert len(strict_tables) == 0, "Upgraded database should not have STRICT tables" |
| 698 | |
| 699 | # Verify BLOB->TEXT migration ran for faildetail cleanup. |
| 700 | result = l1.db_query( |
| 701 | "SELECT COUNT(*) as count FROM payments " |
| 702 | "WHERE typeof(faildetail) = 'blob'" |
| 703 | ) |
| 704 | assert result[0]['count'] == 0, "Found BLOB-typed faildetail after migration" |
nothing calls this directly
no test coverage detected