Skip to content

Commit

Permalink
feat(migrations): update provider_logs with workspace_id from provide…
Browse files Browse the repository at this point in the history
…r_api_keys

This commit introduces a new SQL migration that updates the `workspace_id` field in the `provider_logs` table by joining it with the `provider_api_keys` table. The update is performed only for records where `workspace_id` is currently NULL. This ensures that all provider logs are correctly associated with their respective workspaces, improving data consistency and integrity.

Additionally, the corresponding snapshot and journal files have been updated to reflect this migration.
  • Loading branch information
geclos committed Oct 28, 2024
1 parent ecde89e commit 39e318f
Show file tree
Hide file tree
Showing 3 changed files with 3,595 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/core/drizzle/0085_tan_wilson_fisk.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- Custom SQL migration file, put you code below! --
UPDATE provider_logs
SET workspace_id = provider_api_keys.workspace_id
FROM provider_api_keys
WHERE provider_logs.provider_id = provider_api_keys.id
AND provider_logs.workspace_id IS NULL;
Loading

0 comments on commit 39e318f

Please sign in to comment.