(new_column: str = "media")
| 29 | conn.close() |
| 30 | |
| 31 | def alter_db_add_screenshot(new_column: str = "media"): |
| 32 | check_db_path() |
| 33 | try: |
| 34 | conn = sqlite3.connect(DB_PATH) |
| 35 | cursor = conn.cursor() |
| 36 | cursor.execute(f'ALTER TABLE crawled_data ADD COLUMN {new_column} TEXT DEFAULT ""') |
| 37 | conn.commit() |
| 38 | conn.close() |
| 39 | except Exception as e: |
| 40 | print(f"Error altering database to add screenshot column: {e}") |
| 41 | |
| 42 | def check_db_path(): |
| 43 | if not DB_PATH: |
nothing calls this directly
no test coverage detected
searching dependent graphs…