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:
parent
48550c81aa
commit
304b660c9d
7 changed files with 28 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -10,7 +10,6 @@ module.exports = createTransactionalMigration(
|
|||
|
||||
const integration = await knex('integrations').where({
|
||||
slug: 'ghost-explore',
|
||||
type: 'internal',
|
||||
name: 'Ghost Explore'
|
||||
}).first();
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
);
|
|
@ -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"}]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
|
@ -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"}]
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue