feat(agent): add teamId foreign key to agent table and refactor service queries

This commit is contained in:
yiling
2026-05-21 20:41:37 +08:00
parent 6e2ff8a003
commit 2c106bbb77
16 changed files with 498 additions and 71 deletions
@@ -0,0 +1,11 @@
/*
Warnings:
- Added the required column `team_id` to the `agents` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "agents" ADD COLUMN "team_id" TEXT NOT NULL;
-- AddForeignKey
ALTER TABLE "agents" ADD CONSTRAINT "agents_team_id_fkey" FOREIGN KEY ("team_id") REFERENCES "teams"("id") ON DELETE CASCADE ON UPDATE CASCADE;