lazyBoy/migrations/029_computer_boot_attempts.sql

7 lines
438 B
MySQL
Raw Normal View History

2026-09-11 02:47:43 +00:00
-- A crashed API must not leave permanent booting state. Attempt identity fences
-- late replies after a timed-out attempt is reclaimed by another API process.
ALTER TABLE computers ADD COLUMN boot_attempt TEXT;
ALTER TABLE computers ADD COLUMN boot_started_at TIMESTAMPTZ;
UPDATE computers SET boot_started_at=updated_at WHERE state='booting';
CREATE INDEX computer_boot_deadline_idx ON computers(boot_started_at) WHERE state='booting';