Repository navigation
Drop the admin's and sign-in's tables, and stop requiring Neon Auth's users_sync - #214
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (12)
💤 Files with no reviewable changes (4)
Limit details: You’ve used the included review currently available. Your 112 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. 📜 Recent review details⏰ Context from checks skipped due to timeout. (6)
🧰 Additional context used🪛 Squawk (2.65.0)app/migrations/0035_drop_admin_tables.sql[warning] 1-1: Dropping a table may break existing clients. (ban-drop-table) [warning] 2-2: Dropping a table may break existing clients. (ban-drop-table) 🔇 Additional comments (1)
📝 WalkthroughWalkthroughThe changes remove Neon Auth-linked tables from the app schema and migrations. Schema snapshots now cover only ChangesNeon Auth schema removal
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to This change drops the unused admin and sign-in tables and narrows schema snapshots to the site's own schemas. The production migration path drops the tables without CASCADE and fails safely if anything unexpected depends on them. No merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change separates the site database from Neon Auth without deleting Neon's schema. The documented production migration stops on unexpected dependencies, and no new attacker-controlled access path was identified. Risk remains low rather than minimal because committed deletion is irreversible through these migrations, and live deployment and recovery conditions were not independently verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
✨ Simplify code
Usage-based review receipt
Note This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing. Comment |
Preview · Change Stack · Checks · Files: +2760 −83 in 12 files
What
Drops the last of the old sign-in from the schema, so turning Neon Auth off can't break the migrator or the tests. It leaves the
neon_authschema alone.core/migrations/0023_drop_admin_tables.tsDROP TABLE "public"."profile_users"andDROP TABLE "public"."administrators", without CASCADE: anything else depending on them would stop the migration.publicorplanningtoneon_auth.users_sync(administrators_user_id_users_sync_id_fk,profile_users_user_id_users_sync_id_fk). Nothing reads either table since Remove the old app's admin and members' profile pages #207, Remove Stack Auth from the old app: no sign-in, no handler, no dependency #212 and Remove the stdio MCP's administrator tools and their scripts #213.app/migrations/0035_drop_admin_tables.sqland its snapshot.app/src/lib/schema.tsdropsadministratorsTableandprofileUsersTable, and stops declaringneon_auth.users_sync(usersSyncfromdrizzle-orm/neon).DROP TABLE "neon_auth"."users_sync"into 0035. I took it out by hand:neon_authis Neon's.neon_authschema.src/schema-snapshot.tscomparespublicandplanningonly, notneon_auth.tests/fixtures/production-schema.txtloses theneon_auth.users_synclines and the two tables' lines.users_sync, and production is stamped past it. Nothing compares it any more.core/tests/migrations.test.ts):neon_auth. It then drops the wholeneon_authschema and checks the snapshot doesn't change.public.event_posts_event_id_idxinstead of Neon Auth's index.users_syncstay as they are.core/README.md("Migrations").Read-only against production, as site_reader:
bun run migrate --dry-runlists exactly0023_drop_admin_tablesas pending.neon_authare the two this drops.neon_auth.users_synchas about 4 live rows (pg_stat).site_reader can't read the tables themselves.
Before running the migration: archive, as the owner
Run this as
neondb_owner(users_syncholds people's names and emails, so the directory is private), then store the files in the allthings vault:The three copies come from one snapshot.
users_sync.raw_jsoncarries everything Stack Auth synced for each user, so restoring needs nothing else. Then, from this PR's final head commit, runbun run migrate --dry-runand thenbun run migrate(core/README.md, "Running them"), and merge.What else ties production to Neon Auth
Read via the Neon API and the repository. I changed nothing.
prod(wispy-sea-75401301), branchmain(br-round-dust-a6avtg0r)stack,owned_by: neon, set up on 2025-09-24, Stack project06a56015-e238-46fb-875e-92ccd980c31b, databaseneondb. Its JWKS ishttps://api.stack-auth.com/api/v1/projects/06a56015-…/.well-known/jwks.json.neon_authschema: owned byneondb_owner. It holdsusers_syncand two indexes,users_sync_pkeyandusers_sync_deleted_at_idx.main/neondb, so nothing there validates Stack JWTs.archive/hackathon-app-2026-10-03(br-polished-feather-a6yijsdo, protected) holds its ownneon_auth.users_sync,administratorsandprofile_usersas of 2026-10-03.hello-chatgptanddev-1(archived) date from 2026-03 and hold the same.STACKenv vars are already gone. If the project is connected through Vercel's Neon integration with Neon Auth enabled, the integration can write them back; turn Neon Auth off there too.app/,core/,web/orinfra/. Two references stay:core/tests/site-sync.test.tschecks the sync role can't readneon_auth.users_sync. In tests that is the baseline's stand-in.Verify
Summary by CodeRabbit