mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
🏗 Dropped webhooks.status
column (#14713)
refs https://github.com/TryGhost/Toolbox/issues/309 - this column is not used and I was going to add `validation` to it but it's better to clean it up and re-add the column if we need it again
This commit is contained in:
parent
7ab00c8eda
commit
84a10daebf
5 changed files with 21 additions and 8 deletions
|
@ -0,0 +1,18 @@
|
||||||
|
const {createDropColumnMigration} = require('../../utils');
|
||||||
|
|
||||||
|
// Preferably I could use `createIrreversibleMigration` here like
|
||||||
|
// `createIrreversibleMigration(createDropColumnMigration(...).up)` but
|
||||||
|
// that seems to throw some obscure error that I'm not sure about... something
|
||||||
|
// to look into for the future
|
||||||
|
module.exports = {
|
||||||
|
...createDropColumnMigration('webhooks', 'status', {}),
|
||||||
|
|
||||||
|
down: async () => {
|
||||||
|
// no-op: we're setting this migration to irreversible so we won't
|
||||||
|
// execute the `down`
|
||||||
|
},
|
||||||
|
|
||||||
|
config: {
|
||||||
|
irreversible: true
|
||||||
|
}
|
||||||
|
};
|
|
@ -341,8 +341,6 @@ module.exports = {
|
||||||
// NOTE: integration_id column needs "nullable: true" -> "nullable: false" migration (recreate table with nullable: false)
|
// NOTE: integration_id column needs "nullable: true" -> "nullable: false" migration (recreate table with nullable: false)
|
||||||
// CASE: Ghost instances initialized pre 4.0 will have this column set to nullable: true in db schema
|
// CASE: Ghost instances initialized pre 4.0 will have this column set to nullable: true in db schema
|
||||||
integration_id: {type: 'string', maxlength: 24, nullable: false, references: 'integrations.id', cascadeDelete: true},
|
integration_id: {type: 'string', maxlength: 24, nullable: false, references: 'integrations.id', cascadeDelete: true},
|
||||||
// @TODO: add isIn validation
|
|
||||||
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'available'},
|
|
||||||
last_triggered_at: {type: 'dateTime', nullable: true},
|
last_triggered_at: {type: 'dateTime', nullable: true},
|
||||||
last_triggered_status: {type: 'string', maxlength: 50, nullable: true},
|
last_triggered_status: {type: 'string', maxlength: 50, nullable: true},
|
||||||
last_triggered_error: {type: 'string', maxlength: 50, nullable: true},
|
last_triggered_error: {type: 'string', maxlength: 50, nullable: true},
|
||||||
|
|
|
@ -14,7 +14,6 @@ Object {
|
||||||
"last_triggered_status": null,
|
"last_triggered_status": null,
|
||||||
"name": "test",
|
"name": "test",
|
||||||
"secret": "thisissecret",
|
"secret": "thisissecret",
|
||||||
"status": "available",
|
|
||||||
"target_url": "http://example.com/webhooks/test/extra/1",
|
"target_url": "http://example.com/webhooks/test/extra/1",
|
||||||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/,
|
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/,
|
||||||
},
|
},
|
||||||
|
@ -26,7 +25,7 @@ exports[`Webhooks API Can create a webhook 2: [headers] 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||||
"content-length": "413",
|
"content-length": "392",
|
||||||
"content-type": "application/json; charset=utf-8",
|
"content-type": "application/json; charset=utf-8",
|
||||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||||
"vary": "Origin, Accept-Encoding",
|
"vary": "Origin, Accept-Encoding",
|
||||||
|
@ -58,7 +57,6 @@ Object {
|
||||||
"last_triggered_status": null,
|
"last_triggered_status": null,
|
||||||
"name": "Edit Test",
|
"name": "Edit Test",
|
||||||
"secret": "thisissecret",
|
"secret": "thisissecret",
|
||||||
"status": "available",
|
|
||||||
"target_url": "https://example.com/new-subscriber",
|
"target_url": "https://example.com/new-subscriber",
|
||||||
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/,
|
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/,
|
||||||
},
|
},
|
||||||
|
@ -70,7 +68,7 @@ exports[`Webhooks API Can edit a webhook 2: [headers] 1`] = `
|
||||||
Object {
|
Object {
|
||||||
"access-control-allow-origin": "http://127.0.0.1:2369",
|
"access-control-allow-origin": "http://127.0.0.1:2369",
|
||||||
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
"cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0",
|
||||||
"content-length": "417",
|
"content-length": "396",
|
||||||
"content-type": "application/json; charset=utf-8",
|
"content-type": "application/json; charset=utf-8",
|
||||||
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
|
||||||
"vary": "Origin, Accept-Encoding",
|
"vary": "Origin, Accept-Encoding",
|
||||||
|
|
|
@ -178,7 +178,6 @@ const expectedProperties = {
|
||||||
'secret',
|
'secret',
|
||||||
'api_version',
|
'api_version',
|
||||||
'integration_id',
|
'integration_id',
|
||||||
'status',
|
|
||||||
'last_triggered_at',
|
'last_triggered_at',
|
||||||
'last_triggered_status',
|
'last_triggered_status',
|
||||||
'last_triggered_error',
|
'last_triggered_error',
|
||||||
|
|
|
@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
|
||||||
*/
|
*/
|
||||||
describe('DB version integrity', function () {
|
describe('DB version integrity', function () {
|
||||||
// Only these variables should need updating
|
// Only these variables should need updating
|
||||||
const currentSchemaHash = '77b49a87395930231fd47ab54d1e558e';
|
const currentSchemaHash = '2f4266e6e5087ad92dd30f3e721d46e5';
|
||||||
const currentFixturesHash = 'f4795020369ec3a770b538be8d8b2536';
|
const currentFixturesHash = 'f4795020369ec3a770b538be8d8b2536';
|
||||||
const currentSettingsHash = 'ffd899a82b0ad2886e92d8244bcbca6a';
|
const currentSettingsHash = 'ffd899a82b0ad2886e92d8244bcbca6a';
|
||||||
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
|
||||||
|
|
Loading…
Add table
Reference in a new issue