Files
spoolman2/migrations
tonym 8681f7aee7
Some checks failed
CI / style (push) Has been cancelled
CI / build-client (push) Has been cancelled
CI / build-amd64 (push) Has been cancelled
CI / build-tester (push) Has been cancelled
CI / test (cockroachdb) (push) Has been cancelled
CI / test (mariadb) (push) Has been cancelled
CI / test (postgres) (push) Has been cancelled
CI / test (sqlite) (push) Has been cancelled
CI / build-arm64 (push) Has been cancelled
CI / build-armv7 (push) Has been cancelled
CI / publish-images (push) Has been cancelled
CI / publish-release (push) Has been cancelled
Issue Manager / issue-manager (push) Has been cancelled
fix: Remove FK constraint from location migration for SQLite compatibility
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:47:58 -06:00
..
2023-05-27 23:14:06 +02:00
2023-08-12 22:33:20 +02:00
2024-01-16 19:17:06 +01:00

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.