Skip to content

drop user_id column from app_email_senders#2754

Open
drew-harris wants to merge 2 commits into
mainfrom
drewh/drop-user-id
Open

drop user_id column from app_email_senders#2754
drew-harris wants to merge 2 commits into
mainfrom
drewh/drop-user-id

Conversation

@drew-harris

@drew-harris drew-harris commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Drops the user_id column from 'app_email_senders'

image

Deploy Plan

Wait for #2753 to fully deploy
Run migration

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 26debf81-008f-457c-8add-036e6760d986

📥 Commits

Reviewing files that changed from the base of the PR and between 7160464 and c574c6b.

📒 Files selected for processing (2)
  • server/resources/migrations/113_drop_user_id_email_senders.down.sql
  • server/resources/migrations/113_drop_user_id_email_senders.up.sql
🚧 Files skipped from review as they are similar to previous changes (1)
  • server/resources/migrations/113_drop_user_id_email_senders.down.sql

📝 Walkthrough

Walkthrough

Migration #113 removes the user_id column from app_email_senders in the up migration and restores it as a uuid with a foreign key in the down migration.

Changes

Email Senders Schema Migration

Layer / File(s) Summary
Migration up — drop user_id
server/resources/migrations/113_drop_user_id_email_senders.up.sql
Alters app_email_senders to drop the user_id column.
Migration down — restore user_id
server/resources/migrations/113_drop_user_id_email_senders.down.sql
Alters app_email_senders to add a user_id column of type uuid with a foreign key reference to instant_users(id) and ON DELETE CASCADE.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • instantdb/instant#2753: Related updates to app_email_senders schema and feature-flag removal tied to dropping user_id.
  • instantdb/instant#2719: Earlier changes that relax/remove user_id usage before this migration drops the column.

Suggested reviewers

  • dwwoelfel
  • stopachka
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly describes the main change: dropping the user_id column from app_email_senders table.
Description check ✅ Passed The description is related to the changeset, explaining the purpose of dropping user_id and providing deployment instructions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch drewh/drop-user-id

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@drew-harris drew-harris changed the base branch from main to drewh/pre-cli-auth-steps June 10, 2026 18:26
Base automatically changed from drewh/pre-cli-auth-steps to main June 10, 2026 18:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@server/resources/migrations/113_drop_user_id_email_senders.down.sql`:
- Around line 1-2: The down migration in
server/resources/migrations/113_drop_user_id_email_senders.down.sql currently
re-adds app_email_senders.user_id as a plain uuid but omits the original foreign
key; update this rollback to re-create the foreign key constraint exactly as in
the original migration by adding the references to instant_users(id) with on
delete cascade for the user_id column on app_email_senders so the schema matches
the pre-migration state.

In `@server/resources/migrations/113_drop_user_id_email_senders.up.sql`:
- Around line 1-2: Confirm that app_email_senders.user_id is safe to drop by
searching the codebase and running tests: verify there are no references to
app_email_senders.user_id in server/src and server/test and ensure any
background jobs or deployed services (including work from PR `#2753`) no longer
read or write that column; if any code or job still expects it, update those
consumers first. If historical user_id values must be preserved, add a
pre-migration step to backfill or copy user_id to a new column/table (or export
it) before removing it, and include a migration rollback plan; finally,
coordinate migration deployment order so running services are updated before
applying the DROP COLUMN in the migration script that removes
app_email_senders.user_id.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 13e31622-73e2-4489-a350-209f8f6e6a5a

📥 Commits

Reviewing files that changed from the base of the PR and between 8abe9aa and 764a61e.

📒 Files selected for processing (2)
  • server/resources/migrations/113_drop_user_id_email_senders.down.sql
  • server/resources/migrations/113_drop_user_id_email_senders.up.sql

Comment thread server/resources/migrations/113_drop_user_id_email_senders.down.sql Outdated
Comment thread server/resources/migrations/113_drop_user_id_email_senders.up.sql
@github-actions

Copy link
Copy Markdown
Contributor

View Vercel preview at instant-www-js-drewh-drop-user-id-jsv.vercel.app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant