Implement multi-organization support#19
Merged
Merged
Conversation
Introduces organizations as the ownership entity for social accounts and posts. Users belong to orgs via memberships with roles (owner/manager/member). Key changes: - Migration 014: organizations + organization_members tables, org-based RLS policies, backfill existing data, move connection FK from profile_id to organization_id - Org context via signed JWT cookie (org-context.ts) with switcher UI - Posts page shows "My Posts" vs "All Posts" filter, always scoped to active org - Core business logic (publish, stats, comments) resolves connections from post.organization_id instead of cookie-based org lookup, fixing SMS/cron contexts - New post creation uses LLM to infer target org for multi-org SMS users - Docker dev environment with volume mounts for hot-reload - Tests updated for org-scoped data model throughout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… flows Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Resolve conflict in account-view.tsx: keep org-scoped connection queries, reauth warnings, and pending Facebook token state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migration 014 (from main) added a profile_id-based SELECT policy. Our org migration drops profile_id, so we need to explicitly drop that policy and replace it with org-scoped equivalents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Add multi-organization data model and org-scoped queries. Users can now create organizations, switch between them, and access org-specific posts and accounts. Introduces org membership tracking, seeding data for multiple organizations, and updates all API routes and UI components to respect organization scope.
Changes
organizationsandorganization_memberstables with RLS policies/org/create,/org/list,/org/switchTokenLifetimeMsconstant to tests for consistencyTest plan
npm run test:dockerto verify all tests pass🤖 Generated with Claude Code