Added a primary key to the brute table

issue https://github.com/TryGhost/Team/issues/267
This commit is contained in:
Thibaut Patel 2021-02-25 15:55:19 +01:00 committed by Thibaut Patel
parent d7f432af0d
commit 4a939054ba
3 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,9 @@
const logging = require('../../../../../shared/logging');
const {createIrreversibleMigration} = require('../../utils');
const {addPrimaryKey} = require('../../../schema/commands');
module.exports = createIrreversibleMigration(async (knex) => {
logging.info('Adding a primary key for the brute table');
await addPrimaryKey('brute', 'key', knex);
});

View File

@ -252,7 +252,7 @@ module.exports = {
updated_by: {type: 'string', maxlength: 24, nullable: true}
},
brute: {
key: {type: 'string', maxlength: 191},
key: {type: 'string', maxlength: 191, primary: true},
firstRequest: {type: 'bigInteger'},
lastRequest: {type: 'bigInteger'},
lifetime: {type: 'bigInteger'},

View File

@ -32,7 +32,7 @@ const defaultSettings = require('../../../../core/server/data/schema/default-set
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '5861ed57418a0195ea01e431b8b55335';
const currentSchemaHash = 'd44979f33e39fafd9e1e25dd48e0d5d2';
const currentFixturesHash = '370d0da0ab7c45050b2ff30bce8896ba';
const currentSettingsHash = 'e1f85186a7c7ed76064b6026f68c6321';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';