Sybren A. Stüvel 0c4240ec3a Manager: make some db fields boolean instead of smallint
Turn `workers.lazy_status_request` and `workers.can_restart` into a
`boolean`. They were `smallint` before.

Having these explicitly modeled as `boolean` will make sqlc generate the
right type for them.

No functional changes.
2024-05-28 18:15:21 +02:00
..
2024-03-04 13:06:09 +01:00

SQL Migrations

The files here are run by Goose, the database migration tool.

These are embedded into the Flamenco Manager executable, and automatically run on startup.

Foreign Key Constraints

Foreign Key constraints (FKCs) are optional in SQLite, and always enabled by Flamenco Manager. These are temporarily disabled during database migration itself. This means you can replace a table like this, without ON DELETE effects running.

INSERT INTO `temp_table` SELECT field1, field2, etc FROM `actual_table`;
DROP TABLE `actual_table`;
ALTER TABLE `temp_table` RENAME TO `actual_table`;

Note that the SELECT clause lists each field specifically. This is to ensure that they are selected in the expected order. Without this, data can get mangled.