This refactor was born out of the inter-dependency cycles developing between the "background" module and just about every other module which was caused by the background module becoming a dependency of every module that needed to background work and the fact that the background module was also supposedly responsible for the logic for processing those tasks. Instead the "background" module is now very, very shallow and relies entirely on the Postgres NOTIFY logic for triggering jobs. There's a new table, `job` which holds just a type and single row ID. All told, this means that jobs can be added to the queue as part of the API-level or platform-level transaction, ensuring atomicity, and processing coordination is handled by the platform module, which can depend on anything.
7 lines
214 B
SQL
7 lines
214 B
SQL
-- +goose Up
|
|
ALTER TABLE note_audio
|
|
ADD COLUMN id INTEGER GENERATED ALWAYS AS IDENTITY;
|
|
ALTER TABLE note_audio
|
|
ADD CONSTRAINT note_audio_id_unique UNIQUE (id);
|
|
-- +goose Down
|
|
ALTER TABLE note_audio DROP COLUMN id;
|