Skip to content

Commit

Permalink
Added migration to include donation_message in donation_payment_events (
Browse files Browse the repository at this point in the history
#20839)

ref PLG-197

- DB migration to add `donation_message` to `donation_payment_events`
table
  • Loading branch information
ronaldlangeveld authored Aug 28, 2024
1 parent a79ab03 commit 41e696f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253

const {createAddColumnMigration} = require('../../utils');

module.exports = createAddColumnMigration('donation_payment_events', 'donation_message', {
type: 'string',
maxlength: 255, // as per stripe limitation for custom fields https://docs.stripe.com/payments/checkout/custom-fields
nullable: true
});
3 changes: 2 additions & 1 deletion ghost/core/core/server/data/schema/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@ module.exports = {
referrer_source: {type: 'string', maxlength: 191, nullable: true},
referrer_medium: {type: 'string', maxlength: 191, nullable: true},
referrer_url: {type: 'string', maxlength: 2000, nullable: true},
created_at: {type: 'dateTime', nullable: false}
created_at: {type: 'dateTime', nullable: false},
donation_message: {type: 'string', maxlength: 255, nullable: true} // https://docs.stripe.com/payments/checkout/custom-fields
},
stripe_products: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
Expand Down
2 changes: 1 addition & 1 deletion ghost/core/test/unit/server/data/schema/integrity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = 'ce97eff9bf1b3c215fed1271f9275f83';
const currentSchemaHash = 'b59d502d0e7965a837bb1dfb5c583562';
const currentFixturesHash = 'a489d615989eab1023d4b8af0ecee7fd';
const currentSettingsHash = '051ef2a50e2edb8723e89461448313cb';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';
Expand Down

0 comments on commit 41e696f

Please sign in to comment.