1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 17:02:41 +01:00
phorge-phorge/resources/sql/patches/031.workerrace.sql
epriestley ca7a0de1cf Prevent a race in Phabricator workers
Summary: See D133. Workers can also be subject to the same race, invert the
row relationship in the same way.

Test Plan: Launched repository master daemons and some taskmasters and used
the Daemon console to veify that they were able to process tasks. Manually
checked the database to make sure data got linked correctly and that new data
was inserted correctly.

Reviewers: jungejason

CC: tuomaspelkonen

Differential Revision: 135
2011-04-14 12:09:56 -07:00

13 lines
337 B
SQL

ALTER TABLE phabricator_worker.worker_task
ADD dataID int unsigned;
ALTER TABLE phabricator_worker.worker_task
ADD UNIQUE KEY (dataID);
UPDATE phabricator_worker.worker_task t,
phabricator_worker.worker_taskdata d
SET t.dataID = d.id
WHERE d.taskID = t.id;
ALTER TABLE phabricator_worker.worker_taskdata
DROP taskID;