Files
Donkie 332b3e0fe4 Revert "Give phase 2 somewhere to record a tag's instance identity"
This reverts 9aea271.

The column bought one thing, that phase 2 would need no migration, and
cost something worse: it commits the schema to a shape nobody has run a
decoder against. Width, and above all the choice not to make it unique,
were read off a design document rather than off working code, and
goeland86's codec in #880 computes an effective_instance_uuid that may
not mean the same thing. Getting that wrong leaves us altering a
populated column on four databases, which is the exact operation the
"settle the shape before release" rule exists to avoid.

That rule earns its keep for target_type, target_value and filament_id,
where retrofitting a discriminator or a nullability change is painful.
Appending one nullable column later is not painful, so phase 2 can add
it when there is something to write into it.
2026-08-20 19:15:35 +02: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.