@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user