Backend for tracking print jobs from Elegoo/Orca Slicer: - PrintJob model: tracks pending/completed/cancelled jobs - API endpoints: create, list, complete, cancel jobs - needs_weighing flag on Spool: for cancelled print recalibration - Database migration for new table and column Workflow: 1. Slicer post-processing script creates pending job 2. User completes job → auto-deducts filament 3. User cancels job → flags spool for manual weigh-in Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrations
Migrations are used to create and update the database schema. They are run automatically every time Spoolman starts.
To create a new migration, edit the tables as desired in spoolman/database/models.py, then start the Spoolman server to update your local sqlite database.
pdm run python -m spoolman.main
Stop the server once it's up.
Then, let Alembic automatically create a new migration file:
pdm run alembic revision -m "some title" --autogenerate
Go into the created migration and make sure it looks good, that the column changes etc are as desired. Format it with Black and Ruff. Commit.