Repository navigation
[AISAGE-729] chore(db): drop unused tables - #7765
Merged
Merged
Conversation
…pass_org_term_transitions tables
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThis PR cleanly removes three unused tables ( Files Reviewed (9 files)
Verification Notes
Reviewed by deepseek-v4.1-flash · Input: 71K · Output: 9.4K · Cached: 976K Review guidance: REVIEW.md from base branch |
1 task
chrarnoldus
changed the base branch from
main
to
chore/stop-using-dropped-tables
October 16, 2026 14:20
chrarnoldus
enabled auto-merge
October 16, 2026 15:53
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
Important
Stacked on #7767, which removes all runtime references to these tables first, because rollout is gradual. Merge this only after #7767 is fully rolled out to production. This PR contains only the schema change and the generated migration.
Drops the shared PostgreSQL tables that nothing in the codebase reads or writes anymore. I checked every
pgTable/pgViewinpackages/db/src/schema.tsfor references by export name and SQL name in non-test code, with the GDPR soft-delete and migrations excluded. I also searched the Kilo-Org GitHub org, includingkilocode-dbtand thedata-opsSnowflake replication config.free_model_usage8d7dc6c947succeeded).user_period_cachesoftDeleteUser.kilo_pass_org_term_transitions-v1term versions, and the table can be re-added if term migrations are ever built.The migration is generated (
0281_drop_unused_tables.sql: threeDROP TABLE ... CASCADE). Only outbound FKs exist and no views depend on these tables. None of them is replicated to Snowflake or referenced by dbt.Unused tables kept on purpose
stripe_early_fraud_warning_actions: production code never writes or reads it, but it is the action ledger required by.specs/stripe-early-fraud-warnings.md. The spec rolls out in stages: the persistence foundation ships inert before action processing. The tests intentionally assert that observation-only ingestion creates no action rows.Follow-up candidate (not in this PR)
slack_bot_requests: nothing has written it since feat(bot): route Slack app through Chat SDK #2738 (Apr 2026), so the admin Slack bot stats page only shows stale data. It's still read by that page, replicated to Snowflake (data-ops/snowflake/config.py), and has a dbt staging model (stg_backend__slack_bot_requests). Dropping it needs coordination with analytics.Verification
pnpm drizzle generate: the generated migration contains only the three dropsapps/web(tsgo --noEmit) andpackages/db, with this PR and [AISAGE-729] chore(web): stop using tables before dropping them #7767 applied togetherapps/websrc/lib/user/index.test.tspasses (181 tests) on a freshly migrated DB including0281packages/dbjest including DB-backed suites passes, except a known failure onmain: the enum snapshot is missingTodoItemSessionOriginfrom feat(mobile): in-app to-do lists linked to agent sessions #7449, which is unrelated to this changeVisual Changes
N/A
Reviewer Notes
free_model_usage.user_period_cache(if any) is not served by any code path, so its share links are already dead.