solutions/open-source/schema.sql
One row per track and version. The worker and the webhook are the only writers.
SQL file, 27 lines, from the open-source folder of Spatial9 Agent Skills: free, MIT licensed code for immersive audio with the Spatial9 MCP server and A2A agent. Last updated .
Raw file · View on GitHub · Download every file as a zip
-- One row per track and version. The worker and the webhook are the only writers.
CREATE TABLE IF NOT EXISTS tracks (
track_id text NOT NULL,
version int NOT NULL DEFAULT 1,
object_key text NOT NULL, -- path in the masters bucket
status text NOT NULL DEFAULT 'pending'
CHECK (status IN ('pending', 'rejected', 'submitted', 'working', 'completed', 'failed', 'canceled')),
task_id text, -- Spatial9 A2A task id
loudness_lufs numeric, -- integrated loudness measured by FFmpeg
outputs jsonb NOT NULL DEFAULT '[]', -- [{name, key}] saved in the immersive bucket
error text NOT NULL DEFAULT '',
updated_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (track_id, version)
);
CREATE UNIQUE INDEX IF NOT EXISTS tracks_task_id ON tracks (task_id) WHERE task_id IS NOT NULL;
-- Append-only audit trail: every state change, from any source.
CREATE TABLE IF NOT EXISTS track_events (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
track_id text NOT NULL,
version int NOT NULL,
event text NOT NULL,
detail text NOT NULL DEFAULT '',
at timestamptz NOT NULL DEFAULT now()
);
More in open-source
- solutions/open-source/dagster_catalog.py
- solutions/open-source/docker-compose.yml
- solutions/open-source/env.example
- solutions/open-source/preview.html
- solutions/open-source/prometheus.yml
- solutions/open-source/README.md
- solutions/open-source/requirements.txt
- solutions/open-source/webhook.py
- solutions/open-source/worker.py