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:
parent
70cadcd974
commit
ea8c42411f
2 changed files with 32 additions and 0 deletions
|
@ -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,
|
||||||
|
},
|
||||||
|
|
||||||
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
|
||||||
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
|
||||||
|
|
|
@ -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');
|
||||||
|
});
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue