diff --git a/ghost/core/core/server/data/migrations/versions/6.25/2026-03-26-15-47-00-insert-default-email-design-settings-row.js b/ghost/core/core/server/data/migrations/versions/6.25/2026-03-26-15-47-00-insert-default-email-design-settings-row.js new file mode 100644 index 00000000000..b240df2bc83 --- /dev/null +++ b/ghost/core/core/server/data/migrations/versions/6.25/2026-03-26-15-47-00-insert-default-email-design-settings-row.js @@ -0,0 +1,42 @@ +const logging = require('@tryghost/logging'); +const {default: ObjectID} = require('bson-objectid'); +const {createTransactionalMigration} = require('../../utils'); + +const DEFAULT_SLUG = 'default-automated-email'; + +module.exports = createTransactionalMigration( + async function up(knex) { + logging.info('Inserting default email_design_settings row'); + + const existing = await knex('email_design_settings').where({slug: DEFAULT_SLUG}).first(); + + if (existing) { + logging.warn('Default email_design_settings row already exists, skipping'); + return; + } + + await knex('email_design_settings').insert({ + id: (new ObjectID()).toHexString(), + slug: DEFAULT_SLUG, + background_color: 'light', + header_background_color: 'transparent', + show_header_title: true, + button_color: 'accent', + button_corners: 'rounded', + button_style: 'fill', + link_color: 'accent', + link_style: 'underline', + body_font_category: 'sans_serif', + title_font_category: 'sans_serif', + title_font_weight: 'bold', + image_corners: 'square', + show_badge: true, + created_at: knex.raw('current_timestamp') + }); + }, + async function down(knex) { + logging.info('Deleting default email_design_settings row'); + + await knex('email_design_settings').where({slug: DEFAULT_SLUG}).del(); + } +); diff --git a/ghost/core/core/server/data/schema/fixtures/fixtures.json b/ghost/core/core/server/data/schema/fixtures/fixtures.json index ca4818246c4..4f270977a16 100644 --- a/ghost/core/core/server/data/schema/fixtures/fixtures.json +++ b/ghost/core/core/server/data/schema/fixtures/fixtures.json @@ -51,6 +51,14 @@ } ] }, + { + "name": "EmailDesignSetting", + "entries": [ + { + "slug": "default-automated-email" + } + ] + }, { "name": "Tag", "entries": [ diff --git a/ghost/core/core/server/models/email-design-setting.js b/ghost/core/core/server/models/email-design-setting.js new file mode 100644 index 00000000000..a26a02fce4c --- /dev/null +++ b/ghost/core/core/server/models/email-design-setting.js @@ -0,0 +1,27 @@ +const ghostBookshelf = require('./base'); + +const EmailDesignSetting = ghostBookshelf.Model.extend({ + tableName: 'email_design_settings', + + defaults() { + return { + background_color: 'light', + header_background_color: 'transparent', + show_header_title: true, + button_color: 'accent', + button_corners: 'rounded', + button_style: 'fill', + link_color: 'accent', + link_style: 'underline', + body_font_category: 'sans_serif', + title_font_category: 'sans_serif', + title_font_weight: 'bold', + image_corners: 'square', + show_badge: true + }; + } +}); + +module.exports = { + EmailDesignSetting: ghostBookshelf.model('EmailDesignSetting', EmailDesignSetting) +}; diff --git a/ghost/core/package.json b/ghost/core/package.json index a1393a819d1..5a600d2897d 100644 --- a/ghost/core/package.json +++ b/ghost/core/package.json @@ -1,6 +1,6 @@ { "name": "ghost", - "version": "6.24.0", + "version": "6.25.0-rc.0", "description": "The professional publishing platform", "author": "Ghost Foundation", "homepage": "https://ghost.org", diff --git a/ghost/core/test/unit/server/data/schema/integrity.test.js b/ghost/core/test/unit/server/data/schema/integrity.test.js index 39841804286..e7107a95a7e 100644 --- a/ghost/core/test/unit/server/data/schema/integrity.test.js +++ b/ghost/core/test/unit/server/data/schema/integrity.test.js @@ -36,7 +36,7 @@ const validateRouteSettings = require('../../../../../core/server/services/route describe('DB version integrity', function () { // Only these variables should need updating const currentSchemaHash = 'c193998d02d13e8b85162315d938772c'; - const currentFixturesHash = '4dcbd7b52bc9ce23e6f5f1673118ba73'; + const currentFixturesHash = '987b256376357b65fb0d9ef7137c0b00'; const currentSettingsHash = 'a102b80d2ab0cd92325ed007c94d7da6'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';