Mark the lead's messages and answers as the lead's, not the human's
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
CREATE TABLE inbox_items_next (
|
||||
id TEXT PRIMARY KEY,
|
||||
project_id TEXT NOT NULL REFERENCES projects(id),
|
||||
task_id TEXT NOT NULL REFERENCES tasks(id),
|
||||
agent_session_id TEXT NOT NULL REFERENCES agent_sessions(id),
|
||||
thread_id TEXT NOT NULL,
|
||||
priority INTEGER NOT NULL DEFAULT 0,
|
||||
blocking INTEGER NOT NULL DEFAULT 1,
|
||||
payload TEXT NOT NULL,
|
||||
state TEXT NOT NULL,
|
||||
snoozed_until TEXT,
|
||||
created_at TEXT NOT NULL,
|
||||
resolved_by TEXT,
|
||||
resolved_at TEXT
|
||||
);
|
||||
INSERT INTO inbox_items_next SELECT id, project_id, task_id, agent_session_id, thread_id, priority, blocking, payload, state, snoozed_until, created_at, resolved_by, resolved_at FROM inbox_items;
|
||||
DROP TABLE inbox_items;
|
||||
ALTER TABLE inbox_items_next RENAME TO inbox_items;
|
||||
CREATE INDEX inbox_items_open ON inbox_items(state, created_at);
|
||||
CREATE INDEX inbox_items_session ON inbox_items(agent_session_id, state);
|
||||
|
||||
CREATE TABLE inbox_responses_next (
|
||||
id TEXT PRIMARY KEY,
|
||||
item_id TEXT NOT NULL REFERENCES inbox_items(id),
|
||||
actor TEXT NOT NULL,
|
||||
type TEXT NOT NULL,
|
||||
text TEXT,
|
||||
attachments TEXT NOT NULL,
|
||||
snooze_until TEXT,
|
||||
created_at TEXT NOT NULL,
|
||||
delivered_at TEXT,
|
||||
options TEXT,
|
||||
images TEXT NOT NULL DEFAULT '[]',
|
||||
snapshot_n INTEGER
|
||||
);
|
||||
INSERT INTO inbox_responses_next SELECT id, item_id, user_login, type, text, attachments, snooze_until, created_at, delivered_at, options, images, snapshot_n FROM inbox_responses;
|
||||
DROP TABLE inbox_responses;
|
||||
ALTER TABLE inbox_responses_next RENAME TO inbox_responses;
|
||||
CREATE INDEX inbox_responses_item ON inbox_responses(item_id, created_at);
|
||||
Reference in New Issue
Block a user