diff --git a/app/models/apikey.model.js b/app/models/apikey.model.js index 15e061c..44ec13d 100644 --- a/app/models/apikey.model.js +++ b/app/models/apikey.model.js @@ -11,7 +11,14 @@ module.exports = (sequelize, Sequelize) => { }, akKEY: { field: 'akKEY', - type: Sequelize.STRING + // Migration 20260518000000-hash-api-keys.js changed the DB + // column from `uuid` to `text` so it can hold a SHA-256 + // hex digest (64 chars) without a length cap. The model + // had been left at `Sequelize.STRING` (varchar(255)), + // which doesn't break runtime — hashes fit comfortably + // — but `sequelize.sync()` and any schema-introspection + // tooling would disagree with the DB. Use TEXT to match. + type: Sequelize.TEXT }, akCompanyId: { field: 'akCompanyId', diff --git a/app/models/apimaster.model.js b/app/models/apimaster.model.js index 121f407..91da9ea 100644 --- a/app/models/apimaster.model.js +++ b/app/models/apimaster.model.js @@ -11,7 +11,12 @@ module.exports = (sequelize, Sequelize) => { }, amKEY: { field: 'amKEY', - type: Sequelize.STRING + // Same DB column-type change as ApiKey.akKEY — see + // migration 20260518000000-hash-api-keys.js. The column + // is TEXT in PG; the model previously declared STRING + // (varchar(255)) which still works at runtime but drifts + // from the DB schema. Aligned to TEXT for parity. + type: Sequelize.TEXT }, amArchive: { field: 'amArchive',