3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-08-14 17:05:31 +00:00

Test status db schema

`--status` reports if the schema doesn't match.
`--statusreset` is able to perform a hard reset, dropping all the existing tables and calling `_setup()`.
This commit is contained in:
Krystine Sherwin 2025-07-08 15:44:01 +12:00
parent ad9382d46c
commit 10040ce859
No known key found for this signature in database
2 changed files with 66 additions and 50 deletions

View file

@ -85,12 +85,14 @@ if status_show or status_reset:
status_db = SbyStatusDb(status_path, task=None)
if status_show:
status_db.print_status_summary()
sys.exit(0)
if status_reset:
status_db.reset()
elif status_db.test_schema():
print(f"ERROR: Status database does not match expected formatted. Use --statusreset to reset.")
sys.exit(1)
if status_show:
status_db.print_status_summary()
status_db.db.close()
sys.exit(0)