Files
MikrotikManager/backend/drizzle/0033_flow_settings_intents.sql
T

12 lines
516 B
SQL

-- A claim survives unknown results and is never recycled for another attempt.
CREATE TABLE IF NOT EXISTS flow_settings_intents (
receipt_id uuid NOT NULL,
phase text NOT NULL CHECK (phase IN ('configuration', 'listener')),
request_proof text NOT NULL,
state text NOT NULL DEFAULT 'claimed' CHECK (state IN ('claimed', 'completed')),
result jsonb,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (receipt_id, phase)
);
INSERT INTO traffic_flow_settings(id) VALUES(1) ON CONFLICT DO NOTHING;