1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

feat: apiKey migration

This commit is contained in:
Samuel 2025-07-13 01:00:33 +02:00
parent 70cadcd974
commit ea8c42411f
2 changed files with 32 additions and 0 deletions

View file

@ -204,6 +204,19 @@ module.exports = {
type: 'ref', type: 'ref',
columnName: 'password_changed_at', columnName: 'password_changed_at',
}, },
apiKeyPrefix: {
type: 'string',
columnName: 'api_key_prefix',
isNotEmptyString: true,
allowNull: true,
unique: true,
},
apiKeyHash: {
type: 'string',
columnName: 'api_key_hash',
isNotEmptyString: true,
allowNull: true,
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗ // ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗ // ║╣ ║║║╠╩╗║╣ ║║╚═╗

View file

@ -0,0 +1,19 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
exports.up = (knex) => {
return knex.schema.alterTable('user_account', (table) => {
table.string('api_key_prefix', 255).unique().nullable();
table.string('api_key_hash', 255).nullable();
});
};
exports.down = (knex) => {
return knex.schema.alterTable('user_account', (table) => {
table.dropUnique(['api_key_prefix']);
table.dropColumn('api_key_prefix');
table.dropColumn('api_key_hash');
});
};