0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -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:
Daniel Lockyer 2022-05-11 14:11:47 +01:00 committed by GitHub
parent 7ab00c8eda
commit 84a10daebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 8 deletions

View file

@ -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
}
};

View file

@ -341,8 +341,6 @@ module.exports = {
// 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
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_status: {type: 'string', maxlength: 50, nullable: true},
last_triggered_error: {type: 'string', maxlength: 50, nullable: true},

View file

@ -14,7 +14,6 @@ Object {
"last_triggered_status": null,
"name": "test",
"secret": "thisissecret",
"status": "available",
"target_url": "http://example.com/webhooks/test/extra/1",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/,
},
@ -26,7 +25,7 @@ exports[`Webhooks API Can create a webhook 2: [headers] 1`] = `
Object {
"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",
"content-length": "413",
"content-length": "392",
"content-type": "application/json; charset=utf-8",
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
"vary": "Origin, Accept-Encoding",
@ -58,7 +57,6 @@ Object {
"last_triggered_status": null,
"name": "Edit Test",
"secret": "thisissecret",
"status": "available",
"target_url": "https://example.com/new-subscriber",
"updated_at": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}/,
},
@ -70,7 +68,7 @@ exports[`Webhooks API Can edit a webhook 2: [headers] 1`] = `
Object {
"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",
"content-length": "417",
"content-length": "396",
"content-type": "application/json; charset=utf-8",
"etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,
"vary": "Origin, Accept-Encoding",

View file

@ -178,7 +178,6 @@ const expectedProperties = {
'secret',
'api_version',
'integration_id',
'status',
'last_triggered_at',
'last_triggered_status',
'last_triggered_error',

View file

@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '77b49a87395930231fd47ab54d1e558e';
const currentSchemaHash = '2f4266e6e5087ad92dd30f3e721d46e5';
const currentFixturesHash = 'f4795020369ec3a770b538be8d8b2536';
const currentSettingsHash = 'ffd899a82b0ad2886e92d8244bcbca6a';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';