Files
story/migrations/000069_firmware_short_download.up.sql
T
Codex Local bf1233d5df
ci / verify (push) Canceled after 0s
feat: expand companion platform, device controls, and memoir workflows
Add customer and operator login, BLE provisioning, device fleet controls, call memory, memoir generation, and refreshed family and maintenance portals. Include API contracts, migrations, firmware sources, tests, assets, and deployment documentation.
2026-10-08 10:06:44 +08:00

11 lines
599 B
SQL

CREATE TABLE fleet_firmware_download_ticket (
token_hash bytea PRIMARY KEY CHECK(octet_length(token_hash)=32),
release_id uuid NOT NULL REFERENCES fleet_firmware(id) ON DELETE CASCADE,
ota_id uuid REFERENCES fleet_ota(id) ON DELETE CASCADE,
expires_at timestamptz NOT NULL,
revoked_at timestamptz,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE UNIQUE INDEX fleet_firmware_download_ticket_ota ON fleet_firmware_download_ticket(ota_id) WHERE ota_id IS NOT NULL;
CREATE INDEX fleet_firmware_download_ticket_expiry ON fleet_firmware_download_ticket(expires_at) WHERE revoked_at IS NULL;