0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Added migrations to change Ghost Explore integration type

This commit is contained in:
Aileen Booker 2022-08-01 08:08:06 +01:00 committed by GitHub
parent 48550c81aa
commit 304b660c9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 6 deletions

View file

@ -6,7 +6,6 @@ module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Creating Ghost Explore Integration');
const existingIntegration = await knex('integrations').where({
type: 'internal',
name: 'Ghost Explore',
slug: 'ghost-explore'
}).first();

View file

@ -10,7 +10,6 @@ module.exports = createTransactionalMigration(
const integration = await knex('integrations').where({
slug: 'ghost-explore',
type: 'internal',
name: 'Ghost Explore'
}).first();

View file

@ -0,0 +1,24 @@
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Changing Ghost Explore Integration to type "builtin"');
await knex('integrations')
.where({
name: 'Ghost Explore',
slug: 'ghost-explore'
})
.update('type', 'builtin');
},
async function down(knex) {
logging.info('Changing Ghost Explore Integration to type "internal"');
await knex('integrations')
.where({
name: 'Ghost Explore',
slug: 'ghost-explore'
})
.update('type', 'internal');
}
);

View file

@ -672,7 +672,7 @@
"slug": "ghost-explore",
"name": "Ghost Explore",
"description": "Built-in Ghost Explore integration",
"type": "internal",
"type": "builtin",
"api_keys": [{"type": "admin", "role": "Ghost Explore Integration"}]
},
{

View file

@ -23,7 +23,7 @@ describe('Integrations API', function () {
.expect('Cache-Control', testUtils.cacheRules.private)
.expect(200);
should.equal(res.body.integrations.length, 2);
should.equal(res.body.integrations.length, 3);
// there is no enforced order for integrations which makes order different on SQLite and MySQL
const zapierIntegration = _.find(res.body.integrations, {name: 'Zapier'}); // from migrations

View file

@ -36,7 +36,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '71daf7814834fffd40abba86a92f4347';
const currentFixturesHash = 'a42105cc0d47dd978dd52ee271340013';
const currentFixturesHash = 'a75211a41f515202280be7cb287e101f';
const currentSettingsHash = 'd54210758b7054e2174fd34aa2320ad7';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';

View file

@ -845,7 +845,7 @@
"slug": "ghost-explore",
"name": "Ghost Explore",
"description": "Built-in Ghost Explore integration",
"type": "internal",
"type": "builtin",
"api_keys": [{"type": "admin", "role": "Ghost Explore Integration"}]
},
{