mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-17 03:38:32 +02:00
Add owner_id to agent_runtime table to track who registered each runtime. Backend: new delete endpoint with role-based permissions (owner/admin can delete any, members only their own), list filtering by owner (?owner=me), and agent dependency check before deletion. Frontend: Mine/All filter toggle in runtime list, owner display in list items and detail view, delete button with AlertDialog confirmation. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
10 lines
295 B
SQL
10 lines
295 B
SQL
ALTER TABLE agent_runtime ADD COLUMN owner_id UUID REFERENCES "user"(id);
|
|
|
|
-- Backfill: set existing runtimes' owner to the workspace owner
|
|
UPDATE agent_runtime ar
|
|
SET owner_id = (
|
|
SELECT m.user_id FROM member m
|
|
WHERE m.workspace_id = ar.workspace_id AND m.role = 'owner'
|
|
LIMIT 1
|
|
);
|