-
Notifications
You must be signed in to change notification settings - Fork 894
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(migrations): fixed tool unique contraint
- Loading branch information
1 parent
001c289
commit e588162
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
memory-store/migrations/000021_fix_toolname_contraint.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
memory-store/migrations/000021_fix_toolname_contraint.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |