This commit is contained in:
seb
2026-10-12 18:01:25 +02:00
parent 2e961252f7
commit 88ff9e08a9
12 changed files with 104 additions and 27 deletions

View File

@@ -819,10 +819,12 @@ BEGIN
created_at DATETIME2 NOT NULL CONSTRAINT DF_modelconversation_created_at DEFAULT SYSUTCDATETIME(),
updated_at DATETIME2 NOT NULL CONSTRAINT DF_modelconversation_updated_at DEFAULT SYSUTCDATETIME(),
state NVARCHAR(20) NOT NULL CONSTRAINT DF_modelconversation_state DEFAULT 'idle',
started_by INT NULL, -- id of the conversation that started this one as a subagent; deliberately NOT a foreign key
CONSTRAINT FK_modelconversation_companyuser FOREIGN KEY (companyuser_id) REFERENCES companyuser(id) ON DELETE CASCADE,
CONSTRAINT CK_modelconversation_state CHECK (state IN ('idle', 'busy'))
);
CREATE INDEX IX_modelconversation_companyuser ON modelconversation (companyuser_id, updated_at);
CREATE INDEX IX_modelconversation_started_by ON modelconversation (started_by);
END
`;