Skip to content

Schema cleanup, stage 1: remove unused parts, add org status and role - #241

Closed
engleek wants to merge 1 commit into
mainfrom
chore/schema-stage-1
Closed

engleek wants to merge 1 commit into
mainfrom
chore/schema-stage-1

Conversation

@engleek

@engleek engleek commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Part of #150, stage 1 of 5: removals, indexes, and the #39 and #40 fields. Decisions are recorded on #150.

Removed

  • Tables: entity_image, entity_member, game_author, reset_token.
  • Columns: game.tag_list, game_event.tags, person.github_id, person.steam_id, person.password_hash.
  • Code:
    • the /signup, /forgot and /reset/:token routes;
    • SignupForm (and its story), ForgotForm, PasswordResetForm, PasswordChangeForm, both password inputs, and email.server.js;
    • the @sendgrid/mail dependency;
    • the GitHub links on the profile and admin users pages, along with computePerson's call to the GitHub API. There was never a GitHub sign-in.
  • Org deletion no longer clears members. /admin/missing lists games without studios, since no game had authors.

Dropping password_hash also makes the leaked hashes from GHSA-297v-vhxj-rvqg useless once this is deployed.

Added

Schema only for now; the forms and filters follow on #39, #40 and #211.

Indexes: on foreign keys and filtered columns, which Postgres doesn't create on its own. For example event(starts_at), entity(type), location(country_code), game(deleted), change(table_name, record_id), and the join tables' second keys.

Migration

Before deploying, on production or on the dump, check what will be dropped:

SELECT (SELECT count(*) FROM entity_member) AS members,
       (SELECT count(*) FROM game_author) AS authors,
       (SELECT count(*) FROM entity_image) AS org_images,
       (SELECT count(*) FROM reset_token) AS reset_tokens,
       (SELECT count(*) FROM person WHERE password_hash IS NOT NULL) AS password_users;

Back up first.

Tests

  • Fresh database: the full migration chain plus the seed apply to an empty database, as in CI.
  • Locally: after applying the migration, the full e2e suite (53) and the unit and story tests (74) pass.

🤖 Generated with Claude Code

Part of #150, as decided there:
- Drop entity_image, entity_member, game_author and reset_token, and
  game.tag_list, game_event.tags, person.github_id, steam_id and
  password_hash (passwords are dropped: sign-in moves to Bluesky).
- Remove the sign-up, forgot and reset routes, their forms and password
  inputs, SendGrid, and the GitHub profile links (no GitHub sign-in).
- Org deletion no longer clears members; /admin/missing lists games
  without studios.
- Add entity.status (#39: active, closed, hiatus; default active) and
  game_entity.role (#40: developer, co_developer, publisher, porting,
  support; default developer). UI follows.
- Index foreign keys and filtered columns.

The migration drops with IF EXISTS / CASCADE so it doesn't depend on
production's constraint names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@engleek

engleek commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #249, which merged this change into main.

@engleek engleek closed this Oct 4, 2026
@engleek
engleek deleted the chore/schema-stage-1 branch October 9, 2026 20:14
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