Features:
- Create manual database checkpoints with descriptions
- List all available checkpoints with statistics
- Restore database from checkpoints (with dangerous operation warning)
- Delete unwanted checkpoints
- Frontend UI integrated into database admin panel
- JSON-based checkpoint storage in data/checkpoints/
Backend Changes:
- Added checkpoint management functions to licensing_repo.py:
* create_checkpoint() - backup all tables to JSON
* list_checkpoints() - enumerate checkpoint files
* restore_checkpoint() - restore from checkpoint
* delete_checkpoint() - remove checkpoint file
- Added 4 new API endpoints to v2.py:
* GET /admin/checkpoints - list checkpoints
* POST /admin/checkpoints - create checkpoint
* POST /admin/checkpoints/{id}/restore - restore checkpoint
* DELETE /admin/checkpoints/{id} - delete checkpoint
Frontend Changes (db_admin.html):
- Added step 5 "检查点管理" to navigation
- Created checkpoint management UI with forms and lists
- Added dangerous operation confirmation modal
- Integrated into existing breadcrumb navigation system
Safety Features:
- All dangerous operations require explicit confirmation
- Restore operations show warning about data loss
- Checkpoints include row counts and table statistics
- Timestamped checkpoint IDs for easy identification
Note: Checkpoint files are stored in data/checkpoints/ directory
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| lawrisk_service.py | ||
| lawrisk_v2_service.py | ||
| licensing_repo.py | ||