Skip to content

fix(models): ApiKey.akKEY + ApiMaster.amKEY are TEXT, not STRING (#318)#319

Merged
CryptoJones merged 1 commit into
masterfrom
fix/apikey-model-text-type
May 19, 2026
Merged

fix(models): ApiKey.akKEY + ApiMaster.amKEY are TEXT, not STRING (#318)#319
CryptoJones merged 1 commit into
masterfrom
fix/apikey-model-text-type

Conversation

@CryptoJones
Copy link
Copy Markdown
Owner

Closes #318.

Summary

Aligns both auth-key models to the DB column type changed by 20260518000000-hash-api-keys.js. Runtime-safe; this just keeps sequelize.sync() and schema-introspection tooling in agreement with the DB.

Test plan

  • npm run lint && npm test — 781 passing (unchanged; runtime-equivalent change).

Proudly Made in Nebraska. Go Big Red! 🌽 https://xkcd.com/2347/

Migration 20260518000000-hash-api-keys.js changed both columns from
`uuid` to `text` so they can hold a SHA-256 hex digest (64 chars)
without a length cap. The Sequelize models were left at
`Sequelize.STRING`, which Sequelize defaults to `VARCHAR(255)`.

This doesn't break runtime — 64-char hashes fit comfortably in
varchar(255) — but it leaves the model out of sync with the
authoritative DB schema. Any operator running `sequelize.sync()` or
piping the model definitions through schema-introspection tooling
would get the wrong column type back.

Align both models to `Sequelize.TEXT` and document the migration
reference inline so future readers can follow the trail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CryptoJones CryptoJones merged commit d2b29a7 into master May 19, 2026
3 checks passed
@CryptoJones CryptoJones deleted the fix/apikey-model-text-type branch May 19, 2026 17:48
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.

Model/DB drift: ApiKey.akKEY + ApiMaster.amKEY are TEXT in DB, STRING in model

1 participant