[WIP] ποΈ feat(database): add workspace support schema and migration#15414
Closed
rdmclin2 wants to merge 2 commits into
Closed
[WIP] ποΈ feat(database): add workspace support schema and migration#15414rdmclin2 wants to merge 2 commits into
rdmclin2 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #15414 +/- ##
==========================================
- Coverage 71.02% 69.88% -1.14%
==========================================
Files 3212 3139 -73
Lines 321285 305146 -16139
Branches 29240 26340 -2900
==========================================
- Hits 228179 213251 -14928
+ Misses 92931 91720 -1211
Partials 175 175
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
tjx666
requested changes
Jun 2, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4fba540 to
8d7f0ca
Compare
arvinxx
added a commit
that referenced
this pull request
Jun 3, 2026
Bring over only the standalone `workspace.ts` schema from #15414 β the workspaces / workspace_members / workspace_invitations / workspace_audit_logs tables (self-contained, FK to users only). None of #15414's workspaceId column additions across other tables are included. Migration is 0108-safe, renumbered to 0107. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arvinxx
added a commit
that referenced
this pull request
Jun 3, 2026
Bring over only the standalone `workspace.ts` schema from #15414 β the workspaces / workspace_members / workspace_invitations / workspace_audit_logs tables (self-contained, FK to users only). None of #15414's workspaceId column additions across other tables are included. Migration is 0108-safe, renumbered to 0107. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
arvinxx
added a commit
that referenced
this pull request
Jun 3, 2026
* β¨ feat(db): add usage column to messages table Promote token usage/cost out of `metadata.usage` into a dedicated `messages.usage` jsonb column, with btree expression indexes on `usage.cost` and `usage.totalTokens`. Additive only β no data backfill; `metadata.usage` stays the source of truth during the transition. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * β¨ feat(db): add agent share schema (picked from #15430) Bring the agent-share schema layer over from #15430: new `agent_shares` table + `topics.sender_id` column/index, schema relations and barrel export. Migration renumbered to 0106 to sit after the usage column. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * β¨ feat(db): add workspace schema (picked from #15414) Bring over only the standalone `workspace.ts` schema from #15414 β the workspaces / workspace_members / workspace_invitations / workspace_audit_logs tables (self-contained, FK to users only). None of #15414's workspaceId column additions across other tables are included. Migration is 0108-safe, renumbered to 0107. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ποΈ chore(db): squash usage/agent-share/workspace into one migration Collapse the three stacked migrations (0105 usage, 0106 agent_share, 0107 workspace) into a single idempotent 0105_add_usage_agent_share_workspace. Schema source is unchanged; only the migration files/snapshot/journal are consolidated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * β test(db): add senderId to expected topic shape in create test The picked agent-share schema added topics.senderId, so the created row now returns it; update the two toEqual assertions accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
4 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract the database layer of the workspace feature: workspace tables, workspace_id columns across existing tables, the 0105_add_workspace_support migration (+ snapshot/journal), and the regenerated database-schema.dbml.
π» Change Type
π Related Issue
π Description of Change
π§ͺ How to Test
πΈ Screenshots / Videos
π Additional Information