Coverage for reset_erp.py: 0%

8 statements  

« prev     ^ index     » next       coverage.py v7.16.0, created at 2026-10-17 16:50 +0800

1import sqlite3 

2c = sqlite3.connect('db.sqlite3') 

3cur = c.cursor() 

4# Delete erp migration records 

5cur.execute("DELETE FROM django_migrations WHERE app='erp'") 

6# Drop all erp tables 

7for row in cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND name LIKE 'erp_%'"): 

8 cur.execute(f"DROP TABLE IF EXISTS {row[0]}") 

9c.commit() 

10print("Done - erp migration state cleared and tables dropped")