This commit is contained in:
@@ -173,3 +173,20 @@ CREATE TABLE IF NOT EXISTS customer_link_tokens (
|
||||
created_at INTEGER NOT NULL
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS customer_link_tokens_exp_idx ON customer_link_tokens(expires_at);
|
||||
|
||||
-- Durable outbox for hosted-worker positive-tip rewards. A "positive tip" is
|
||||
-- a signed guess that improves that worker's personal best score. Delivery to
|
||||
-- Customer Service is retried and the event id is idempotent there.
|
||||
CREATE TABLE IF NOT EXISTS hosted_credit_events (
|
||||
event_id TEXT PRIMARY KEY,
|
||||
worker_client_id TEXT NOT NULL REFERENCES clients(id) ON DELETE CASCADE,
|
||||
reward_client_id TEXT NOT NULL REFERENCES clients(id) ON DELETE CASCADE,
|
||||
task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
|
||||
seq INTEGER NOT NULL,
|
||||
score REAL NOT NULL,
|
||||
created_at INTEGER NOT NULL,
|
||||
delivered_at INTEGER,
|
||||
attempts INTEGER NOT NULL DEFAULT 0,
|
||||
last_error TEXT NOT NULL DEFAULT ''
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS hosted_credit_events_pending_idx ON hosted_credit_events(delivered_at,created_at);
|
||||
|
||||
Reference in New Issue
Block a user