Sybren A. Stüvel 7f37c16a8d Add 'index in job' number to tasks
Number the tasks in a job, indicating their creation order. This gives the
web interface something to sort on that doesn't change on task updates.
2024-11-09 23:07:23 +01: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.