chore: fix down migration

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-11-18 12:29:24 +01:00
parent 064471c87f
commit 3511ba4431
@@ -29,6 +29,12 @@ exports.up = async function up(knex) {
* @param {import('knex').Knex} knex
*/
exports.down = async function down(knex) {
// Delete sessions with state > 255 chars since they won't fit in varchar(255)
// These sessions would be unusable with truncated state anyway
await knex('oauth_authorization_sessions')
.whereRaw('LENGTH(state) > 255')
.delete();
await knex.schema.alterTable('oauth_authorization_sessions', table => {
table.string('state').nullable().alter();
});