Skip to content

Epic: five database tables ship on every deployment and no code reads them #192

Closed
2 of 7 issues completed

Description

@imshashank

Orbit's schema contains several tables that are created on every deployment, migrated, indexed, and never read or written by a single line of application code.

They are not mistakes. They are the shape of features that were designed and then not built, and because the schema work is already done and already reviewed, they are unusually good contribution targets. The hardest decision on most features, which is how to model it, has been made.

The dormant tables

Verified by grepping the whole repository for each table outside packages/db/src/schema and packages/db/tests:

Table In packages/db/src/schema/ Application code that touches it
webhook, webhook_log comms.ts None
automation_rule comms.ts None
audit_log comms.ts None
api_key comms.ts None
module, module_member, module_issue, module_link work.ts Only the Plane importer
intake, intake_issue work.ts Only the Plane importer

The only references anywhere else are in packages/db/tests/schema/index.test.ts, which asserts the tables exist, and in packages/db/src/import/, which populates modules and intake when importing from Plane. So a Plane import today writes rows that nothing in Orbit can display.

Why this matters beyond tidiness

  • A self hoster reading the schema reasonably concludes Orbit has an audit log. It does not.
  • A Plane import silently drops the user's modules and intake into tables with no UI, which looks like data loss.
  • Five migrations run on every deployment for features nobody can use.

The issues under this epic

Each is independent:

  1. Outbound webhooks, which is #126 and already open. The webhook and webhook_log tables are waiting for it.
  2. Add the narrow GitHub lifecycle automation rules #193 automation rules: when this happens, do that
  3. The audit log table is never written to #194 an audit log that is actually written
  4. Personal API keys and a public REST API #195 personal API keys and a public REST API
  5. Modules: four tables the Plane importer fills and nothing displays #196 modules: a UI for the tables the Plane importer already fills
  6. Intake and triage: a front door for issues from outside the team #197 intake and triage: same
  7. Jira and GitHub Issues importers #229 Jira and GitHub Issues importers, which is where the module and intake tables came from

The alternative is to delete them

If a table has no owner and no plan, dropping it is a better outcome than leaving it to imply a feature that does not exist. If you think one of these should go rather than be built, say so on this thread. That is a legitimate and welcome position, and "delete automation_rule" is a perfectly good pull request if the discussion lands there.

What is not acceptable is leaving them exactly as they are, because the current state misleads everyone who reads the schema.

Sub-issues

Sub-issues

2 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    p1 high
    area: database
    epic
    dead code
    on Aug 8, 2026
  2. moved this to Backlog in Orbit roadmapon Aug 8, 2026
  3. added
    size: extra large
    points: 13
    schema change
    on Aug 8, 2026
  4. imshashank commented on Aug 15, 2026

    @imshashank
    ContributorAuthor

    Re-verified on 3ba32cb, and the table has changed

    Every table listed here is still dormant, so the epic stands. Two rows are now worse than described, and the count in the title is low.

    Table Application code that touches it Change
    webhook, webhook_log, webhook_delivery None webhook_delivery was not in the original table. Only organization-deletion-service.ts references them, to cascade on delete, which is cleanup rather than use
    automation_rule None unchanged
    audit_log None unchanged
    api_key None unchanged
    module, module_member, module_issue, module_link None was "only the Plane importer"
    intake, intake_issue None was "only the Plane importer"

    Why the last two changed. #287 quarantined the importer tooling and deleted packages/db/src/import/index.ts along with every import script. The parsers and mappers survive as unreachable library code, so nothing populates modules or intake any more.

    That removes one of the arguments in this epic:

    • A Plane import silently drops the user's modules and intake into tables nothing displays

    There is no Plane import. Nothing writes those rows at all now, which makes them cleanly dormant rather than half-used, and it means #196 can be decided purely on whether Orbit wants modules, without the data-loss argument.

    The other arguments are unaffected, and the strongest one is untouched: a self hoster reading the schema reasonably concludes Orbit has an audit log, and it does not. That is #194 and it is the one I would prioritise, since it is the only entry here where the gap between what the schema implies and what the product does could matter to somebody's compliance story.

    Suggested title change. "five database tables" was already an undercount and is now clearly wrong. There are six groups and thirteen tables. Worth renaming to something that does not need editing again, for example "Epic: dormant database tables that ship on every deployment and no code reads".

    Children unchanged: #193 automation rules, #194 audit log, #195 API keys and public REST API, #196 modules, #197 intake. #126 outbound webhooks is the feature behind the webhook tables and is filed outside this epic; worth linking it in as a child, since it is the same class of work.

  5. imshashank commented on Aug 15, 2026

    @imshashank
    ContributorAuthor

    Correcting a row in the table above. I added webhook_delivery to the dormant list and that is wrong.

    webhook_delivery is live. apps/web/src/app/api/webhooks/github/route.ts inserts a row per inbound delivery and updates its status through received, processing and failed, using it to claim and deduplicate deliveries. #248 and #198 both build on it. It should not appear in this epic at all.

    The corrected row:

    Table Application code that touches it
    webhook, webhook_log None. webhook is referenced only by organization-deletion-service.ts for cascade cleanup

    So the count is back to what the original table said for that row, and the epic covers six groups and twelve tables rather than thirteen. Everything else in my comment stands, including the change to the module and intake rows, which I verified separately.

  6. imshashank commented on Sep 6, 2026

    @imshashank
    ContributorAuthor

    Closing the epic with a decision per table, so nobody has to re-derive it:

    The epic's point stands: the schema must not advertise features that do not exist, and those five issues are where that gets fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: databasedead codeepicp1 highpoints: 13schema changesize: extra large

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions