Skip to content

Commit

Permalink
fix(migrations): fixed tool unique contraint
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedantsahai18 committed Jan 7, 2025
1 parent 001c289 commit e588162
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions memory-store/migrations/000021_fix_toolname_contraint.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BEGIN;

-- Drop the updated unique constraint
ALTER TABLE tools DROP CONSTRAINT IF EXISTS ct_unique_name_per_agent;

-- Restore the original unique constraint (without developer_id)
ALTER TABLE tools ADD CONSTRAINT ct_unique_name_per_agent
UNIQUE (agent_id, name, task_id);

COMMIT;
10 changes: 10 additions & 0 deletions memory-store/migrations/000021_fix_toolname_contraint.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BEGIN;

-- Drop the existing unique constraint
ALTER TABLE tools DROP CONSTRAINT IF EXISTS ct_unique_name_per_agent;

-- Add the new unique constraint including developer_id
ALTER TABLE tools ADD CONSTRAINT ct_unique_name_per_agent
UNIQUE (developer_id, agent_id, name, task_id);

COMMIT;

0 comments on commit e588162

Please sign in to comment.