<?xml version="1.0" encoding="UTF-8"?><database name="bufferrhythm" schema="public" type="PostgreSQL - 18.4 (Ubuntu 18.4-1.pgdg24.04+1)">
   <sequences>
      <sequence increment="1" name="device_uptime_log_id_seq" startValue="1"/>
      <sequence increment="1" name="metrics_snapshots_id_seq" startValue="1"/>
   </sequences>
   <tables>
      <table name="consumer_groups" remarks="{&quot;what&quot;:&quot;A consumer group with a single shared offset for its members.&quot;,&quot;why&quot;:&quot;Without it, consumer progress cannot be persisted across restarts.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:21.860390688+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="group_id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique name that identifies the consumer group.&quot;,&quot;why&quot;:&quot;Primary key; needed to address the group when reading or updating its offset.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:21.908783708+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="1" name="last_offset" nullable="false" remarks="{&quot;what&quot;:&quot;Highest committed message offset, starting at 0.&quot;,&quot;why&quot;:&quot;Without it, consumers would not know where to resume after a restart.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:22.041739439+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="created_at" nullable="false" remarks="{&quot;what&quot;:&quot;Creation timestamp of the group, stored as text.&quot;,&quot;why&quot;:&quot;Without it, the group's age cannot be determined for lifecycle management.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:22.147706688+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="updated_at" nullable="false" remarks="{&quot;what&quot;:&quot;Last modification timestamp of the group, stored as text.&quot;,&quot;why&quot;:&quot;Without it, staleness of the offset cannot be assessed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:22.273305964+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="group_id" sequenceNumberInPK="1"/>
         <index name="consumer_groups_pkey" unique="true">
            <column ascending="true" name="group_id"/>
         </index>
      </table>
      <table name="consumer_offsets" remarks="{&quot;what&quot;:&quot;Tracks the last consumed message offset per device for a queue.&quot;,&quot;why&quot;:&quot;Without it, a device restart would re-read old messages or skip new ones.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:11:39.296633216+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="device" nullable="false" remarks="{&quot;what&quot;:&quot;Unique device identifier; primary key for the offset record.&quot;,&quot;why&quot;:&quot;Identifies which device's consumption progress this row tracks.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:11:39.346966358+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="1" name="last_offset" nullable="false" remarks="{&quot;what&quot;:&quot;Last message offset consumed by the device; starts at 0.&quot;,&quot;why&quot;:&quot;Enables resuming consumption from the correct position after a restart.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:11:39.376232275+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="updated_at" nullable="false" remarks="{&quot;what&quot;:&quot;Timestamp of the last offset update, stored as text (e.g., ISO 8601).&quot;,&quot;why&quot;:&quot;Shows how recent the offset is; helps detect stale or inactive devices.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:11:39.430598899+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="device" sequenceNumberInPK="1"/>
         <index name="consumer_offsets_pkey" unique="true">
            <column ascending="true" name="device"/>
         </index>
      </table>
      <table name="dead_letters" remarks="{&quot;what&quot;:&quot;Table holding tasks that failed permanently after retries.&quot;,&quot;why&quot;:&quot;Without it, failed tasks would be lost, preventing investigation and manual recovery.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:30.956600029+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique identifier for this dead-letter record; UUID or similar.&quot;,&quot;why&quot;:&quot;Without it, records cannot be referenced or updated individually.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.020601740+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="original_task_id" nullable="false" remarks="{&quot;what&quot;:&quot;Identifier of the original task that failed; matches a task ID in the main queue.&quot;,&quot;why&quot;:&quot;Without it, the failed task cannot be traced back to its source for retry or analysis.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.037426370+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="device" nullable="false" remarks="{&quot;what&quot;:&quot;Device identifier (e.g., serial number) that the task was intended for.&quot;,&quot;why&quot;:&quot;Without it, failures cannot be grouped by device to detect hardware-specific issues.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.059306247+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="task_type" nullable="false" remarks="{&quot;what&quot;:&quot;Type of task (e.g., 'firmware_update', 'diagnostic') that failed.&quot;,&quot;why&quot;:&quot;Without it, failure patterns by task category cannot be identified for prioritization.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.075343478+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="payload" nullable="false" remarks="{&quot;what&quot;:&quot;Original task payload as JSON or serialized string; used for retry.&quot;,&quot;why&quot;:&quot;Without it, the task cannot be re-executed or inspected for the exact input that caused failure.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.089104800+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="attempts" nullable="false" remarks="{&quot;what&quot;:&quot;Number of times the task was attempted before being dead-lettered.&quot;,&quot;why&quot;:&quot;Without it, retry policies cannot be enforced or the failure severity assessed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.187714957+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="last_error" nullable="true" remarks="{&quot;what&quot;:&quot;Last error message or stack trace from the final failed attempt.&quot;,&quot;why&quot;:&quot;Without it, the cause of failure is unknown, hindering debugging and alerting.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.202873540+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="7" name="dead_at" nullable="false" remarks="{&quot;what&quot;:&quot;Timestamp (ISO 8601) when the task was moved to dead letters.&quot;,&quot;why&quot;:&quot;Without it, the age of the failure cannot be determined for SLA or cleanup decisions.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.260757708+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="acknowledged" nullable="false" remarks="{&quot;what&quot;:&quot;Flag (0/1) indicating whether an operator has acknowledged this dead letter; default 0.&quot;,&quot;why&quot;:&quot;Without it, unacknowledged failures cannot be distinguished from processed ones, risking missed alerts.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:31.400655678+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="dead_letters_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
      </table>
      <table name="device_health" remarks="{&quot;what&quot;:&quot;Per-device health snapshot: reachability, last contact, and failure streak.&quot;,&quot;why&quot;:&quot;Without it, no single place to see device status for monitoring and alerting.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.568151823+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="device" nullable="false" remarks="{&quot;what&quot;:&quot;Unique device identifier (e.g., hostname or IP) used as primary key.&quot;,&quot;why&quot;:&quot;Identifies which device the health row belongs to; enables lookups and joins.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.619960557+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="1" name="reachable" nullable="false" remarks="{&quot;what&quot;:&quot;Boolean flag (0/1) indicating if the device responded to the last check.&quot;,&quot;why&quot;:&quot;Without it, cannot quickly filter or alert on unreachable devices.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.646755722+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="last_seen" nullable="true" remarks="{&quot;what&quot;:&quot;Timestamp (text) of the last successful contact from the device.&quot;,&quot;why&quot;:&quot;Shows staleness; without it, cannot tell if a device is just quiet or truly down.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.667353300+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="last_check" nullable="true" remarks="{&quot;what&quot;:&quot;Timestamp (text) of the most recent health check attempt.&quot;,&quot;why&quot;:&quot;Distinguishes 'never checked' from 'checked but unreachable'; needed for scheduling.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.691829307+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="4" name="consecutive_failures" nullable="false" remarks="{&quot;what&quot;:&quot;Count of sequential failed checks since the last success.&quot;,&quot;why&quot;:&quot;Enables threshold-based alerting (e.g., after 3 failures) without scanning history.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.713556833+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <primaryKey column="device" sequenceNumberInPK="1"/>
         <index name="device_health_pkey" unique="true">
            <column ascending="true" name="device"/>
         </index>
      </table>
      <table name="device_uptime_log" remarks="" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('device_uptime_log_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique numeric identifier for each log entry.&quot;,&quot;why&quot;:&quot;Allows each row to be referenced and updated independently; no natural key exists.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:12:04.584699589+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="device" nullable="false" remarks="{&quot;what&quot;:&quot;Identifier of the monitored device, e.g. hostname or IP.&quot;,&quot;why&quot;:&quot;Groups log entries per device; without it, entries cannot be attributed to a specific device.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:12:04.603385594+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="reachable" nullable="false" remarks="{&quot;what&quot;:&quot;Integer flag: 1 if device responded, 0 otherwise.&quot;,&quot;why&quot;:&quot;Records the outcome of each check; without it, uptime cannot be computed.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:12:04.615772949+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="timestamp" nullable="false" remarks="{&quot;what&quot;:&quot;Time the check was performed, stored as text (format not enforced).&quot;,&quot;why&quot;:&quot;Orders entries chronologically; without it, the sequence of checks is unknown.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T00:12:04.638205075+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="device_uptime_log_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_uptime_device_ts" unique="false">
            <column ascending="true" name="device"/>
            <column ascending="true" name="timestamp"/>
         </index>
      </table>
      <table name="metrics_snapshots" remarks="" schema="public" type="TABLE">
         <column autoUpdated="true" defaultValue="nextval('metrics_snapshots_id_seq'::regclass)" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique numeric identifier for each snapshot row.&quot;,&quot;why&quot;:&quot;Enables referencing and updating individual snapshots.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.846513559+00:00&quot;}" size="19" type="bigserial" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="timestamp" nullable="false" remarks="{&quot;what&quot;:&quot;Snapshot time as text, likely ISO 8601 format.&quot;,&quot;why&quot;:&quot;Orders snapshots chronologically and correlates with other events.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.878297415+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="pending" nullable="false" remarks="{&quot;what&quot;:&quot;Number of jobs waiting to be processed at snapshot time.&quot;,&quot;why&quot;:&quot;Tracks backlog size to detect queue buildup.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.911951336+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="running" nullable="false" remarks="{&quot;what&quot;:&quot;Number of jobs currently executing at snapshot time.&quot;,&quot;why&quot;:&quot;Shows active workload and concurrency level.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:35.952817521+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="retry_wait" nullable="false" remarks="{&quot;what&quot;:&quot;Number of jobs in retry wait state at snapshot time.&quot;,&quot;why&quot;:&quot;Indicates jobs delayed due to failures, helps assess error rates.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:36.000195319+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="5" name="completed" nullable="false" remarks="{&quot;what&quot;:&quot;Number of jobs finished successfully by snapshot time.&quot;,&quot;why&quot;:&quot;Measures throughput and overall progress.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:36.023895637+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="6" name="dead" nullable="false" remarks="{&quot;what&quot;:&quot;Number of jobs that failed permanently at snapshot time.&quot;,&quot;why&quot;:&quot;Reveals failure rate and need for intervention.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:36.045668996+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="metrics_snapshots_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_metrics_ts" unique="false">
            <column ascending="true" name="timestamp"/>
         </index>
      </table>
      <table name="tasks" remarks="{&quot;what&quot;:&quot;Work items awaiting or undergoing execution, with retry and scheduling metadata.&quot;,&quot;why&quot;:&quot;Without it, no durable record of pending or in-flight work exists, so failures lose tasks.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.744615550+00:00&quot;}" schema="public" type="TABLE">
         <column autoUpdated="false" defaultValue="null" digits="0" id="0" name="id" nullable="false" remarks="{&quot;what&quot;:&quot;Unique opaque identifier for the task; primary key.&quot;,&quot;why&quot;:&quot;Without it, tasks cannot be referenced or updated individually.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.757788252+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="1" name="log_offset" nullable="false" remarks="{&quot;what&quot;:&quot;Integer offset that orders tasks in the log; higher means later.&quot;,&quot;why&quot;:&quot;Without it, tasks cannot be ordered or replayed in the same sequence after a crash.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.786952756+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="2" name="idempotency_key" nullable="false" remarks="{&quot;what&quot;:&quot;Client-supplied key that identifies a logical operation to deduplicate retries.&quot;,&quot;why&quot;:&quot;Without it, duplicate submissions of the same operation would create multiple tasks.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.807175563+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="3" name="device" nullable="false" remarks="{&quot;what&quot;:&quot;Identifier of the device that submitted or should handle the task.&quot;,&quot;why&quot;:&quot;Without it, tasks cannot be routed to the correct device or filtered per device.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.842472622+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="4" name="task_type" nullable="false" remarks="{&quot;what&quot;:&quot;Name of the task handler or category, e.g. 'email.send'.&quot;,&quot;why&quot;:&quot;Without it, the system cannot decide which code path executes the task.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.863617627+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'{}'::text" digits="0" id="5" name="payload" nullable="false" remarks="{&quot;what&quot;:&quot;JSON string with task-specific arguments; empty object if none.&quot;,&quot;why&quot;:&quot;Without it, the task handler has no input data to act on.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.920321304+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'pending'::text" digits="0" id="6" name="state" nullable="false" remarks="{&quot;what&quot;:&quot;Current lifecycle state: pending, running, succeeded, failed, etc.&quot;,&quot;why&quot;:&quot;Without it, the system cannot know which tasks are actionable or need retry.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.938864128+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="7" name="priority" nullable="false" remarks="{&quot;what&quot;:&quot;Relative importance; higher numbers are processed first.&quot;,&quot;why&quot;:&quot;Without it, all tasks would be equal and urgent work could starve.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:42.966510861+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="0" digits="0" id="8" name="attempt" nullable="false" remarks="{&quot;what&quot;:&quot;Number of execution attempts already made for this task.&quot;,&quot;why&quot;:&quot;Without it, retry limits and backoff cannot be enforced.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.034026776+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="5" digits="0" id="9" name="max_attempts" nullable="false" remarks="{&quot;what&quot;:&quot;Maximum number of attempts before the task is considered failed.&quot;,&quot;why&quot;:&quot;Without it, tasks could retry forever or give up too early.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.055292780+00:00&quot;}" size="10" type="int4" typeCode="4"/>
         <column autoUpdated="false" defaultValue="30" digits="0" id="10" name="backoff_base_secs" nullable="false" remarks="{&quot;what&quot;:&quot;Base delay in seconds before the next retry; grows with attempt count.&quot;,&quot;why&quot;:&quot;Without it, retry timing would be arbitrary or fixed, risking overload.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.068562979+00:00&quot;}" size="19" type="int8" typeCode="-5"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="11" name="created_at" nullable="false" remarks="{&quot;what&quot;:&quot;ISO 8601 timestamp when the task was created.&quot;,&quot;why&quot;:&quot;Without it, task age and creation order cannot be determined.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.093380373+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="12" name="updated_at" nullable="false" remarks="{&quot;what&quot;:&quot;ISO 8601 timestamp of the last state change.&quot;,&quot;why&quot;:&quot;Without it, stale or stuck tasks cannot be detected.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.116266155+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="13" name="scheduled_at" nullable="true" remarks="{&quot;what&quot;:&quot;ISO 8601 timestamp when the task becomes eligible to run; null means immediate.&quot;,&quot;why&quot;:&quot;Without it, delayed or scheduled tasks cannot be represented.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.144749965+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="14" name="started_at" nullable="true" remarks="{&quot;what&quot;:&quot;ISO 8601 timestamp when the task first started execution.&quot;,&quot;why&quot;:&quot;Without it, execution duration and stuck tasks cannot be measured.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.165983733+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="15" name="completed_at" nullable="true" remarks="{&quot;what&quot;:&quot;ISO 8601 timestamp when the task finished successfully or failed.&quot;,&quot;why&quot;:&quot;Without it, completion time and success/failure timing are unknown.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.214518065+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="16" name="error" nullable="true" remarks="{&quot;what&quot;:&quot;Error message from the last failed attempt; null if none.&quot;,&quot;why&quot;:&quot;Without it, failure reasons are lost, hindering debugging.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.242798798+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="null" digits="0" id="17" name="topic" nullable="true" remarks="{&quot;what&quot;:&quot;Pub/sub topic or queue name the task belongs to, if any.&quot;,&quot;why&quot;:&quot;Without it, tasks cannot be grouped or routed by topic.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.287643912+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <column autoUpdated="false" defaultValue="'local'::text" digits="0" id="18" name="track" nullable="false" remarks="{&quot;what&quot;:&quot;Execution track or environment, e.g. 'local' or 'cloud'.&quot;,&quot;why&quot;:&quot;Without it, tasks cannot be separated by deployment context.&quot;,&quot;by&quot;:&quot;fleet-annotator-worker&quot;,&quot;at&quot;:&quot;2026-09-23T04:20:43.369522264+00:00&quot;}" size="2147483647" type="text" typeCode="12"/>
         <primaryKey column="id" sequenceNumberInPK="1"/>
         <index name="tasks_pkey" unique="true">
            <column ascending="true" name="id"/>
         </index>
         <index name="idx_tasks_lane" unique="false">
            <column ascending="true" name="track"/>
            <column ascending="true" name="task_type"/>
            <column ascending="true" name="state"/>
            <column ascending="false" name="priority"/>
            <column ascending="true" name="log_offset"/>
         </index>
         <index name="idx_tasks_scheduled" unique="false">
            <column ascending="true" name="state"/>
            <column ascending="true" name="scheduled_at"/>
         </index>
         <index name="idx_tasks_state_device" unique="false">
            <column ascending="true" name="state"/>
            <column ascending="true" name="device"/>
            <column ascending="false" name="priority"/>
            <column ascending="true" name="log_offset"/>
         </index>
         <index name="idx_tasks_topic" unique="false">
            <column ascending="true" name="topic"/>
            <column ascending="true" name="log_offset"/>
         </index>
         <index name="tasks_idempotency_key_key" unique="true">
            <column ascending="true" name="idempotency_key"/>
         </index>
         <index name="tasks_log_offset_key" unique="true">
            <column ascending="true" name="log_offset"/>
         </index>
      </table>
   </tables>
</database>
