repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.0/2022-05-11-16-36-remove-unused-settings.js | ghost/core/core/server/data/migrations/versions/5.0/2022-05-11-16-36-remove-unused-settings.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
const settingsToRemove = [
'editor_is_launch_complete',
'members_free_price_name',
'members_free_price_description',
'members_paid_signup_redirect',
'members_free_signup_redirect',
'memb... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.0/2022-04-27-11-26-backfill-mrr-for-canceled-subscriptions.js | ghost/core/core/server/data/migrations/versions/5.0/2022-04-27-11-26-backfill-mrr-for-canceled-subscriptions.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Setting "mrr" to 0 for all canceled subscriptions in "members_stripe_customers_subscriptions"');
awai... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.0/2022-05-09-14-17-cleanup-invalid-users-status.js | ghost/core/core/server/data/migrations/versions/5.0/2022-05-09-14-17-cleanup-invalid-users-status.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info(`Updating users with invalid statuses to 'inactive'`);
const affectedRows = await knex('users')
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.0/2022-05-09-10-00-drop-members-subscribed-column.js | ghost/core/core/server/data/migrations/versions/5.0/2022-05-09-10-00-drop-members-subscribed-column.js | 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.expo... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.0/2022-05-06-08-16-cleanup-client-subscriber-permissions.js | ghost/core/core/server/data/migrations/versions/5.0/2022-05-06-08-16-cleanup-client-subscriber-permissions.js | const {combineTransactionalMigrations, createRemovePermissionMigration} = require('../../utils');
const ROLES = [
'Admin Integration',
'Administrator',
'Author',
'Editor',
'Contributor'
];
const PERMISSIONS = [
{
name: 'Browse clients',
object: 'client',
action: 'browse... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.0/2022-05-04-15-24-map-existing-emails-to-default-newsletter.js | ghost/core/core/server/data/migrations/versions/5.0/2022-05-04-15-24-map-existing-emails-to-default-newsletter.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Linking existing emails and related posts to the default newsletter');
// Get the default newsletter
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.91/2024-08-28-05-28-22-add-donation-message-column-to-donation-payment-events.js | ghost/core/core/server/data/migrations/versions/5.91/2024-08-28-05-28-22-add-donation-message-column-to-donation-payment-events.js | // 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, /... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.7/2025-11-03-15-18-04-add-email-batch-fallback-domain.js | ghost/core/core/server/data/migrations/versions/6.7/2025-11-03-15-18-04-add-email-batch-fallback-domain.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('email_batches', 'fallback_sending_domain', {
type: 'boolean',
nullable: false,
defaultTo: false
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.7/2025-11-02-18-29-37-add-outbox-table.js | ghost/core/core/server/data/migrations/versions/6.7/2025-11-02-18-29-37-add-outbox-table.js | const {addTable} = require('../../utils');
module.exports = addTable('outbox', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
event_type: {type: 'string', maxlength: 50, nullable: false},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'pending'},
payload: {t... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.7/2025-11-03-15-17-05-add-csd-email-count.js | ghost/core/core/server/data/migrations/versions/6.7/2025-11-03-15-17-05-add-csd-email-count.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('emails', 'csd_email_count', {
type: 'integer',
nullable: true,
unsigned: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.82/2024-03-25-16-51-29-drop-email-recipients-non-email-id-indexes.js | ghost/core/core/server/data/migrations/versions/5.82/2024-03-25-16-51-29-drop-email-recipients-non-email-id-indexes.js | // For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const {createNonTransactionalMigration} = require('../../utils');
const commands = require('../../../schema/commands');
module.exports = createNonTransactionalMigration(
async function up... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.82/2024-03-25-16-46-10-add-email-recipients-email-id-indexes.js | ghost/core/core/server/data/migrations/versions/5.82/2024-03-25-16-46-10-add-email-recipients-email-id-indexes.js | // For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const {createNonTransactionalMigration} = require('../../utils');
const commands = require('../../../schema/commands');
module.exports = createNonTransactionalMigration(
async function up... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.19/2022-10-10-10-05-add-members-feedback-table.js | ghost/core/core/server/data/migrations/versions/5.19/2022-10-10-10-05-add-members-feedback-table.js | const {addTable} = require('../../utils');
module.exports = addTable('members_feedback', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
score: {type: 'integer', nullable: false, unsigned: true, defaultTo: 0},
member_id: {type: 'string', maxlength: 24, nullable: false, references: 'm... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.19/2022-10-10-06-58-add-subscriptions-table.js | ghost/core/core/server/data/migrations/versions/5.19/2022-10-10-06-58-add-subscriptions-table.js | const {addTable} = require('../../utils');
module.exports = addTable('subscriptions', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
type: {type: 'string', maxlength: 50, nullable: false},
status: {type: 'string', maxlength: 50, nullable: false},
member_id: {type: 'string', maxl... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.19/2022-09-02-20-52-backfill-new-product-columns.js | ghost/core/core/server/data/migrations/versions/5.19/2022-09-02-20-52-backfill-new-product-columns.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
const rows = await knex('products as t') // eslint-disable-line no-restricted-syntax
.select(
't... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.19/2022-10-11-10-38-add-feedback-enabled-column-to-newsletters.js | ghost/core/core/server/data/migrations/versions/5.19/2022-10-11-10-38-add-feedback-enabled-column-to-newsletters.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('newsletters', 'feedback_enabled', {
type: 'boolean',
nullable: false,
defaultTo: false
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.19/2022-09-02-20-25-add-columns-to-products-table.js | ghost/core/core/server/data/migrations/versions/5.19/2022-09-02-20-25-add-columns-to-products-table.js | const {createAddColumnMigration, combineNonTransactionalMigrations} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('products', 'monthly_price', {
type: 'integer',
unsigned: true,
nullable: true
}),
createAddColumnMigration('pro... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.51/2023-06-07-10-17-add-collections-crud-persmissions.js | ghost/core/core/server/data/migrations/versions/5.51/2023-06-07-10-17-add-collections-crud-persmissions.js | const {combineTransactionalMigrations, addPermissionWithRoles} = require('../../utils');
module.exports = combineTransactionalMigrations(
addPermissionWithRoles({
name: 'Browse collections',
action: 'browse',
object: 'collection'
}, [
'Administrator',
'Admin Integration'... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.51/2023-05-30-19-03-update-pintura-setting.js | ghost/core/core/server/data/migrations/versions/5.51/2023-05-30-19-03-update-pintura-setting.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Updating setting: "pintura" to "true"');
await knex('settings')
.where({
ke... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.1/2025-09-11-00-39-36-tokens-drop-nullable-uuid.js | ghost/core/core/server/data/migrations/versions/6.1/2025-09-11-00-39-36-tokens-drop-nullable-uuid.js | const {createDropNullableMigration} = require('../../utils');
module.exports = createDropNullableMigration('tokens', 'uuid');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.1/2025-09-11-00-39-08-backfill-tokens-uuid.js | ghost/core/core/server/data/migrations/versions/6.1/2025-09-11-00-39-08-backfill-tokens-uuid.js | const logging = require('@tryghost/logging');
const crypto = require('crypto');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
const tokensWithoutUUID = await knex.select('id').from('tokens').whereNull('uuid');
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.1/2025-09-11-00-38-13-add-uuid-column-to-tokens.js | ghost/core/core/server/data/migrations/versions/6.1/2025-09-11-00-38-13-add-uuid-column-to-tokens.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('tokens', 'uuid', {
type: 'string',
maxlength: 36,
nullable: true,
unique: true
}); | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-31-drop-reports-reason.js | ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-31-drop-reports-reason.js | const {createDropColumnMigration} = require('../../utils');
module.exports = createDropColumnMigration('comment_reports', 'reason', {type: 'text', maxlength: 65535, nullable: false});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.5/2022-07-21-08-56-add-jobs-table.js | ghost/core/core/server/data/migrations/versions/5.5/2022-07-21-08-56-add-jobs-table.js | const {addTable} = require('../../utils');
module.exports = addTable('jobs', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
name: {type: 'string', maxlength: 191, nullable: false, unique: true},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'queued', validation... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-32-drop-nullable-member-id-from-likes.js | ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-32-drop-nullable-member-id-from-likes.js | const {createDropNullableMigration} = require('../../utils');
// We need to disable foreign key checks because if MySQL is missing the STRICT_TRANS_TABLES mode, we cannot drop nullable from a foreign key
module.exports = createDropNullableMigration('comment_likes', 'member_id', {disableForeignKeyChecks: true});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-29-add-comment-reporting-permissions.js | ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-29-add-comment-reporting-permissions.js | const {addPermissionWithRoles} = require('../../utils');
module.exports = addPermissionWithRoles({
name: 'Report comments',
action: 'report',
object: 'comment'
}, [
'Administrator',
'Admin Integration'
]);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-33-fix-comments-on-delete-foreign-keys.js | ghost/core/core/server/data/migrations/versions/5.5/2022-07-18-14-33-fix-comments-on-delete-foreign-keys.js | const {addForeign, dropForeign} = require('../../../schema/commands');
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Adding on delete SET NULL for comments')... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.30/2023-01-13-04-25-unsubscribe-suppressed-emails.js | ghost/core/core/server/data/migrations/versions/5.30/2023-01-13-04-25-unsubscribe-suppressed-emails.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
const membersWithSuppressedEmails = await knex.select('members.id').from('members').innerJoin('suppressions', 'members.email... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.58/2023-08-02-09-42-add-donation-settings.js | ghost/core/core/server/data/migrations/versions/5.58/2023-08-02-09-42-add-donation-settings.js | const {combineTransactionalMigrations, addSetting} = require('../../utils');
module.exports = combineTransactionalMigrations(
addSetting({
key: 'donations_currency',
value: 'USD',
type: 'string',
group: 'donations'
}),
addSetting({
key: 'donations_suggested_amount',
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/3.41/01-final-v3.js | ghost/core/core/server/data/migrations/versions/3.41/01-final-v3.js | const {createFinalMigration} = require('../../utils');
module.exports = createFinalMigration(3);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.75/2023-11-27-15-55-add-members-newsletters-index.js | ghost/core/core/server/data/migrations/versions/5.75/2023-11-27-15-55-add-members-newsletters-index.js | const logging = require('@tryghost/logging');
const {createNonTransactionalMigration} = require('../../utils');
const {addIndex, dropIndex} = require('../../../schema/commands');
module.exports = createNonTransactionalMigration(
async function up(knex) {
await addIndex('members_newsletters', ['newsletter_i... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-21-10-30-add-feature-image-to-revisions.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-21-10-30-add-feature-image-to-revisions.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('post_revisions', 'feature_image', {
type: 'string',
maxlength: 2000,
nullable: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-18-12-56-add-announcement-settings.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-18-12-56-add-announcement-settings.js | const {combineTransactionalMigrations, addSetting} = require('../../utils');
module.exports = combineTransactionalMigrations(
addSetting({
key: 'announcement_content',
value: null,
type: 'string',
flags: 'PUBLIC',
group: 'announcement'
}),
addSetting({
key: '... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-20-14-19-add-announcement-visibility-setting.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-20-14-19-add-announcement-visibility-setting.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration, combineTransactionalMigrations, addSetting} = require('../../utils');
const visibilitySettingCleanup = createTransactionalMigration(
async function up(knex) {
const existingSetting = await knex('settings')
.where... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-21-13-01-add-feature-image-meta-to-post-revisions.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-21-13-01-add-feature-image-meta-to-post-revisions.js | const {combineNonTransactionalMigrations,createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('post_revisions', 'feature_image_caption', {
type: 'text',
maxlength: 65535,
nullable: true
}),
createAddColumnMi... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-17-11-05-add-post-revision-author.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-17-11-05-add-post-revision-author.js | const {combineNonTransactionalMigrations,createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('post_revisions', 'author_id', {
type: 'string',
maxlength: 24,
nullable: true,
references: 'users.id',
c... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-21-08-54-add-post-revision-status.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-21-08-54-add-post-revision-status.js | // For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const {combineNonTransactionalMigrations,createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('post_revisions',... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.45/2023-04-19-13-45-add-pintura-settings.js | ghost/core/core/server/data/migrations/versions/5.45/2023-04-19-13-45-add-pintura-settings.js | const {combineTransactionalMigrations, addSetting} = require('../../utils');
module.exports = combineTransactionalMigrations(
addSetting({
key: 'pintura',
value: 'false',
type: 'boolean',
group: 'pintura'
}),
addSetting({
key: 'pintura_js_url',
value: null,
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.127/2025-06-19-13-41-54-add-web-analytics-setting.js | ghost/core/core/server/data/migrations/versions/5.127/2025-06-19-13-41-54-add-web-analytics-setting.js | const {addSetting} = require('../../utils');
module.exports = addSetting({
key: 'web_analytics',
value: 'true',
type: 'boolean',
group: 'analytics'
}); | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.35/2023-02-13-06-24-add-mentions-verified-column.js | ghost/core/core/server/data/migrations/versions/5.35/2023-02-13-06-24-add-mentions-verified-column.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('mentions', 'verified', {
type: 'boolean',
nullable: false,
defaultTo: false
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/1.25/01-final-v1.js | ghost/core/core/server/data/migrations/versions/1.25/01-final-v1.js | const {createFinalMigration} = require('../../utils');
module.exports = createFinalMigration(1);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/1.25/02-noop.js | ghost/core/core/server/data/migrations/versions/1.25/02-noop.js | const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up() {},
async function down() {}
);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.122/2025-06-03-19-32-57-change-default-for-newsletters-button-color.js | ghost/core/core/server/data/migrations/versions/5.122/2025-06-03-19-32-57-change-default-for-newsletters-button-color.js | // For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
// old default was null but that doesn't match our existing button behaviour
// of... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.112/2025-03-10-10-01-01-add-require-mfa-setting.js | ghost/core/core/server/data/migrations/versions/5.112/2025-03-10-10-01-01-add-require-mfa-setting.js | const {addSetting} = require('../../utils');
module.exports = addSetting({
key: 'require_email_mfa',
value: 'false',
type: 'boolean',
group: 'security'
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.11/2022-08-22-11-03-add-member-alert-settings-columns-to-users.js | ghost/core/core/server/data/migrations/versions/5.11/2022-08-22-11-03-add-member-alert-settings-columns-to-users.js | const {createAddColumnMigration, combineNonTransactionalMigrations} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('users', 'free_member_signup_notification', {
type: 'boolean',
nullable: false,
defaultTo: true
}),
createAddCo... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.11/2022-08-23-13-59-fix-page-resource-type.js | ghost/core/core/server/data/migrations/versions/5.11/2022-08-23-13-59-fix-page-resource-type.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info(`Changing Action event 'page' resource_type to 'post'`);
const affectedRows = await knex('actions')
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.11/2022-08-23-13-41-backfill-members-created-events.js | ghost/core/core/server/data/migrations/versions/5.11/2022-08-23-13-41-backfill-members-created-events.js | const ObjectID = require('bson-objectid').default;
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
const members = await knex('members')
.select('id', 'created_... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.72/2023-10-31-11-06-00-members-created-attribution-id-index.js | ghost/core/core/server/data/migrations/versions/5.72/2023-10-31-11-06-00-members-created-attribution-id-index.js | const {createAddIndexMigration} = require('../../utils');
module.exports = createAddIndexMigration('members_created_events', ['attribution_id']);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.72/2023-10-31-11-06-01-members-subscription-created-attribution-id-index.js | ghost/core/core/server/data/migrations/versions/5.72/2023-10-31-11-06-01-members-subscription-created-attribution-id-index.js | const {createAddIndexMigration} = require('../../utils');
module.exports = createAddIndexMigration('members_subscription_created_events', ['attribution_id']);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.3/2025-10-02-15-13-31-add-members-otc-secret-setting.js | ghost/core/core/server/data/migrations/versions/6.3/2025-10-02-15-13-31-add-members-otc-secret-setting.js | const {addSetting} = require('../../utils');
const crypto = require('crypto');
module.exports = addSetting({
key: 'members_otc_secret',
value: crypto.randomBytes(64).toString('hex'),
type: 'string',
group: 'core'
}); | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.61/2023-08-29-11-39-10-add-recommendations-table.js | ghost/core/core/server/data/migrations/versions/5.61/2023-08-29-11-39-10-add-recommendations-table.js | const {addTable} = require('../../utils');
module.exports = addTable('recommendations', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
url: {type: 'string', maxlength: 2000, nullable: false},
title: {type: 'string', maxlength: 2000, nullable: false},
excerpt: {type: 'string', ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.61/2023-08-30-07-37-04-add-recommendations-enabled-settings.js | ghost/core/core/server/data/migrations/versions/5.61/2023-08-30-07-37-04-add-recommendations-enabled-settings.js | const {addSetting} = require('../../utils');
module.exports = addSetting({
key: 'recommendations_enabled',
value: 'false',
type: 'boolean',
group: 'recommendations'
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.61/2023-08-29-10-17-add-recommendations-crud-permissions.js | ghost/core/core/server/data/migrations/versions/5.61/2023-08-29-10-17-add-recommendations-crud-permissions.js | const {combineTransactionalMigrations, addPermissionWithRoles} = require('../../utils');
module.exports = combineTransactionalMigrations(
addPermissionWithRoles({
name: 'Browse recommendations',
action: 'browse',
object: 'recommendation'
}, [
'Administrator',
'Admin Inte... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.10/2025-12-01-21-04-36-add-automated-emails-table.js | ghost/core/core/server/data/migrations/versions/6.10/2025-12-01-21-04-36-add-automated-emails-table.js | const {addTable} = require('../../utils');
module.exports = addTable('automated_emails', {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'inactive'},
slug: {type: 'string', maxlength: 191, nullable: false, unique: tr... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.10/2025-12-01-21-04-37-add-automated-email-permissions.js | ghost/core/core/server/data/migrations/versions/6.10/2025-12-01-21-04-37-add-automated-email-permissions.js | const {combineTransactionalMigrations, addPermissionWithRoles} = require('../../utils');
module.exports = combineTransactionalMigrations(
addPermissionWithRoles({
name: 'Browse automated emails',
action: 'browse',
object: 'automated_email'
}, [
'Administrator',
'Admin In... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.115/2025-03-24-07-19-27-add-identity-read-permission-to-administrators.js | ghost/core/core/server/data/migrations/versions/5.115/2025-03-24-07-19-27-add-identity-read-permission-to-administrators.js | const {addPermissionToRole} = require('../../utils');
module.exports = addPermissionToRole({
permission: 'Read identities',
role: 'Administrator'
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.83/2024-05-28-02-20-55-add-show-subhead-column-newsletters.js | ghost/core/core/server/data/migrations/versions/5.83/2024-05-28-02-20-55-add-show-subhead-column-newsletters.js | // For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('newsletters', 'show_subhead', {
type: 'boolean',
nullable: false,
defaultTo: ... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.2/2025-09-30-14-28-09-add-utm-fields.js | ghost/core/core/server/data/migrations/versions/6.2/2025-09-30-14-28-09-add-utm-fields.js | const {combineNonTransactionalMigrations, createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
// members_created_events
createAddColumnMigration('members_created_events', 'utm_source', {type: 'string', maxlength: 191, nullable: true}, {algorithm: 'auto'}),
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.119/2025-04-30-13-01-28-remove-captcha-setting.js | ghost/core/core/server/data/migrations/versions/5.119/2025-04-30-13-01-28-remove-captcha-setting.js | const {removeSetting} = require('../../utils');
module.exports = removeSetting('captcha_enabled');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.41/2023-03-27-17-51-fix-self-serve-integration-api-key-type.js | ghost/core/core/server/data/migrations/versions/5.41/2023-03-27-17-51-fix-self-serve-integration-api-key-type.js | const {InternalServerError} = require('@tryghost/errors');
const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Updating Admin API key for "Self-Se... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.41/2023-03-27-15-00-add-newsletter-colors.js | ghost/core/core/server/data/migrations/versions/5.41/2023-03-27-15-00-add-newsletter-colors.js | const {createAddColumnMigration, combineNonTransactionalMigrations} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('newsletters', 'background_color', {
type: 'string',
maxlength: 50,
nullable: false,
defaultTo: 'light'
}),
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.22/2022-10-31-12-03-backfill-new-product-columns.js | ghost/core/core/server/data/migrations/versions/5.22/2022-10-31-12-03-backfill-new-product-columns.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
const rows = await knex('products as t') // eslint-disable-line no-restricted-syntax
.select(
't... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.14/2022-09-02-12-55-rename-members-bio-to-expertise.js | ghost/core/core/server/data/migrations/versions/5.14/2022-09-02-12-55-rename-members-bio-to-expertise.js | const DatabaseInfo = require('@tryghost/database-info');
const logging = require('@tryghost/logging');
const {createNonTransactionalMigration} = require('../../utils');
module.exports = createNonTransactionalMigration(
async function up(knex) {
logging.info('Renaming members.bio to members.expertise');
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.100/2024-11-06-04-45-15-add-activitypub-integration.js | ghost/core/core/server/data/migrations/versions/5.100/2024-11-06-04-45-15-add-activitypub-integration.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
const ObjectID = require('bson-objectid').default;
const MIGRATION_USER = 1;
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Adding Ghost ActivityPub integrat... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.100/2024-11-05-14-48-08-add-comments-in-reply-to-id.js | ghost/core/core/server/data/migrations/versions/5.100/2024-11-05-14-48-08-add-comments-in-reply-to-id.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('comments', 'in_reply_to_id', {
type: 'string',
maxlength: 24,
nullable: true,
unique: false,
references: 'comments.id',
setNullDelete: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.100/2024-10-31-15-27-42-add-jobs-queue-columns.js | ghost/core/core/server/data/migrations/versions/5.100/2024-10-31-15-27-42-add-jobs-queue-columns.js | const {combineNonTransactionalMigrations, createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('jobs', 'metadata', {
type: 'string',
maxlength: 2000,
nullable: true
}),
createAddColumnMigration('jobs', 'queu... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.4/2025-10-13-10-18-38-add-tokens-otc-used-count-column.js | ghost/core/core/server/data/migrations/versions/6.4/2025-10-13-10-18-38-add-tokens-otc-used-count-column.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('tokens', 'otc_used_count', {
type: 'integer',
nullable: false,
unsigned: true,
defaultTo: 0
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.69/2023-10-06-15-06-00-rename-recommendations-reason-to-description.js | ghost/core/core/server/data/migrations/versions/5.69/2023-10-06-15-06-00-rename-recommendations-reason-to-description.js | const {createRenameColumnMigration} = require('../../utils');
module.exports = createRenameColumnMigration('recommendations', 'reason', 'description');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-20-13-41-55-remove-created-by-column.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-20-13-41-55-remove-created-by-column.js | const logging = require('@tryghost/logging');
const {createNonTransactionalMigration} = require('../../utils');
async function dropCreatedBy(knex, table) {
const hasCreatedBy = await knex.schema.hasColumn(table, 'created_by');
if (hasCreatedBy) {
logging.info(`Dropping created_by from ${table}`);
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-23-10-03-26-members-nullable-uuid.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-23-10-03-26-members-nullable-uuid.js | const {createDropNullableMigration} = require('../../utils');
// Running drop nullable migration without foreign key checks disabled
// This is because uuid isn't used as a foreign key anywhere in the schema
module.exports = createDropNullableMigration('members', 'uuid');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-24-09-19-42-use-object-id-for-hardcoded-user-id.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-24-09-19-42-use-object-id-for-hardcoded-user-id.js | const logging = require('@tryghost/logging');
const ObjectID = require('bson-objectid').default;
const {createTransactionalMigration} = require('../../utils');
const LEGACY_HARDCODED_USER_ID = '1';
module.exports = createTransactionalMigration(
async function up(knex) {
const newId = (new ObjectID()).toH... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-30-13-59-10-remove-mail-events-table.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-30-13-59-10-remove-mail-events-table.js | const {dropTables} = require('../../utils');
module.exports = dropTables(['temp_mail_events']);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-20-01-41-54-remove-updated-by-column.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-20-01-41-54-remove-updated-by-column.js | const logging = require('@tryghost/logging');
const {createNonTransactionalMigration} = require('../../utils');
async function dropUpdatedBy(knex, table) {
const hasUpdatedBy = await knex.schema.hasColumn(table, 'updated_by');
if (hasUpdatedBy) {
logging.info(`Dropping updated_by from ${table}`);
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-23-09-49-25-add-missing-member-uuids.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-23-09-49-25-add-missing-member-uuids.js | // For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const logging = require('@tryghost/logging');
const crypto = require('crypto');
// For DML - data changes
const {createTransactionalMigration} = require('../../utils');
module.exports = crea... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-25-15-03-29-remove-amp-from-settings.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-25-15-03-29-remove-amp-from-settings.js | const {combineTransactionalMigrations, removeSetting} = require('../../utils');
module.exports = combineTransactionalMigrations(
removeSetting('amp'),
removeSetting('amp_gtag_id')
); | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/6.0/2025-06-30-14-00-00-update-feature-image-alt-length.js | ghost/core/core/server/data/migrations/versions/6.0/2025-06-30-14-00-00-update-feature-image-alt-length.js | const logging = require('@tryghost/logging');
const {createNonTransactionalMigration} = require('../../utils');
const DatabaseInfo = require('@tryghost/database-info');
module.exports = createNonTransactionalMigration(
async function up(knex) {
if (DatabaseInfo.isSQLite(knex)) {
logging.warn('S... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.84/2024-06-04-09-13-33-rename-newsletters-show-subhead.js | ghost/core/core/server/data/migrations/versions/5.84/2024-06-04-09-13-33-rename-newsletters-show-subhead.js | const {createRenameColumnMigration} = require('../../utils');
module.exports = createRenameColumnMigration('newsletters', 'show_subhead', 'show_subtitle');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.84/2024-06-05-13-48-35-rename-newsletters-show-subtitle.js | ghost/core/core/server/data/migrations/versions/5.84/2024-06-05-13-48-35-rename-newsletters-show-subtitle.js | const {createRenameColumnMigration} = require('../../utils');
module.exports = createRenameColumnMigration('newsletters', 'show_subtitle', 'show_excerpt');
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.84/2024-06-05-08-42-34-populate-post-revisions-custom-excerpt.js | ghost/core/core/server/data/migrations/versions/5.84/2024-06-05-08-42-34-populate-post-revisions-custom-excerpt.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up() {
logging.warn('Skipping migration - noop');
},
async function down() {
// Not required
}
);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.84/2024-06-04-11-10-37-add-custom-excerpt-to-post-revisions.js | ghost/core/core/server/data/migrations/versions/5.84/2024-06-04-11-10-37-add-custom-excerpt-to-post-revisions.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('post_revisions', 'custom_excerpt', {
type: 'string',
maxlength: 2000,
nullable: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/2.37/01-final-v2.js | ghost/core/core/server/data/migrations/versions/2.37/01-final-v2.js | const {createFinalMigration} = require('../../utils');
module.exports = createFinalMigration(2);
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-24-07-23-disable-feedback-enabled.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-24-07-23-disable-feedback-enabled.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(connection) {
const affectedRows = await connection('newsletters')
.update({
feedback_enabled: false
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-04-50-member-subscription-created-batch-id.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-04-50-member-subscription-created-batch-id.js | const _ = require('lodash');
const logging = require('@tryghost/logging');
const ObjectId = require('bson-objectid').default;
const {createTransactionalMigration} = require('../../utils');
const DatabaseInfo = require('@tryghost/database-info');
const GhostError = require('@tryghost/errors').GhostError;
// This migrat... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-09-32-add-feedback-enabled-column-to-emails.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-09-32-add-feedback-enabled-column-to-emails.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('emails', 'feedback_enabled', {
type: 'boolean',
nullable: false,
defaultTo: false
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-25-12-05-backfill-missed-products-columns.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-25-12-05-backfill-missed-products-columns.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info(`Fixing currency/monthly_price/yearly_price values for default paid tiers`);
const currencyUpdated = aw... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-04-49-add-batch-id-subscription-created-events.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-04-49-add-batch-id-subscription-created-events.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('members_subscription_created_events', 'batch_id', {
type: 'string',
maxlength: 24,
nullable: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-04-49-add-batch-id-members-created-events.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-26-04-49-add-batch-id-members-created-events.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('members_created_events', 'batch_id', {
type: 'string',
maxlength: 24,
nullable: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.21/2022-10-27-09-50-add-member-track-source-setting.js | ghost/core/core/server/data/migrations/versions/5.21/2022-10-27-09-50-add-member-track-source-setting.js | const {addSetting} = require('../../utils');
module.exports = addSetting({
key: 'members_track_sources',
value: 'true',
type: 'boolean',
group: 'members'
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.8/2022-08-03-15-28-add-trial-start-column-to-stripe-subscriptions.js | ghost/core/core/server/data/migrations/versions/5.8/2022-08-03-15-28-add-trial-start-column-to-stripe-subscriptions.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('members_stripe_customers_subscriptions', 'trial_start_at', {
type: 'dateTime',
nullable: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.8/2022-08-02-06-09-add-trial-period-days-column-to-tiers.js | ghost/core/core/server/data/migrations/versions/5.8/2022-08-02-06-09-add-trial-period-days-column-to-tiers.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('products', 'trial_days', {
type: 'integer',
unsigned: true,
nullable: false,
defaultTo: 0
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.8/2022-08-03-15-29-add-trial-end-column-to-stripe-subscriptions.js | ghost/core/core/server/data/migrations/versions/5.8/2022-08-03-15-29-add-trial-end-column-to-stripe-subscriptions.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('members_stripe_customers_subscriptions', 'trial_end_at', {
type: 'dateTime',
nullable: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.120/2025-05-14-20-00-15-add-newsletters-setting-columns.js | ghost/core/core/server/data/migrations/versions/5.120/2025-05-14-20-00-15-add-newsletters-setting-columns.js | const {combineNonTransactionalMigrations, createAddColumnMigration} = require('../../utils');
module.exports = combineNonTransactionalMigrations(
createAddColumnMigration('newsletters', 'title_font_weight', {
type: 'string',
maxlength: 50,
nullable: false,
defaultTo: 'bold'
}),
... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.120/2025-05-07-14-57-38-add-newsletters-button-corners-column.js | ghost/core/core/server/data/migrations/versions/5.120/2025-05-07-14-57-38-add-newsletters-button-corners-column.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('newsletters', 'button_corners', {
type: 'string',
maxlength: 50,
nullable: false,
defaultTo: 'rounded'
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.120/2025-05-13-17-36-56-add-newsletters-button-style-column.js | ghost/core/core/server/data/migrations/versions/5.120/2025-05-13-17-36-56-add-newsletters-button-style-column.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('newsletters', 'button_style', {
type: 'string',
maxlength: 50,
nullable: false,
defaultTo: 'fill'
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.74/2023-11-14-11-15-00-add-transient-id-column-nullable.js | ghost/core/core/server/data/migrations/versions/5.74/2023-11-14-11-15-00-add-transient-id-column-nullable.js | const {createAddColumnMigration} = require('../../utils');
// First make a nullable column
module.exports = createAddColumnMigration('members', 'transient_id', {
type: 'string',
maxlength: 191,
nullable: true,
unique: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.74/2023-11-14-11-16-00-fill-transient-id-column.js | ghost/core/core/server/data/migrations/versions/5.74/2023-11-14-11-16-00-fill-transient-id-column.js | const logging = require('@tryghost/logging');
const {createTransactionalMigration} = require('../../utils');
module.exports = createTransactionalMigration(
async function up(knex) {
logging.info('Setting transient_id column to email');
const updatedRows = await knex('members')
.update... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.74/2023-11-14-11-17-00-drop-nullable-transient-id-column.js | ghost/core/core/server/data/migrations/versions/5.74/2023-11-14-11-17-00-drop-nullable-transient-id-column.js | const {createDropNullableMigration} = require('../../utils');
// We need to disable foreign key checks because if MySQL is missing the STRICT_TRANS_TABLES mode, we cannot revert the migration
module.exports = createDropNullableMigration('members', 'transient_id', {disableForeignKeyChecks: true});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.59/2023-08-07-11-17-05-add-posts-published-at-index.js | ghost/core/core/server/data/migrations/versions/5.59/2023-08-07-11-17-05-add-posts-published-at-index.js | const logging = require('@tryghost/logging');
const DatabaseInfo = require('@tryghost/database-info');
const {createNonTransactionalMigration} = require('../../utils');
const INDEX_NAME = 'posts_published_at_index';
module.exports = createNonTransactionalMigration(
async function up(knex) {
let hasIndex =... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.59/2023-08-07-10-42-add-donation-notifications-column.js | ghost/core/core/server/data/migrations/versions/5.59/2023-08-07-10-42-add-donation-notifications-column.js | const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('users', 'donation_notifications', {
type: 'boolean',
nullable: false,
defaultTo: true
});
| javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
TryGhost/Ghost | https://github.com/TryGhost/Ghost/blob/31ecb69a147e71743e74014b4e04ccce09ab8c1a/ghost/core/core/server/data/migrations/versions/5.65/2023-09-22-06-42-55-repopulate-built-in-featured-collection-posts.js | ghost/core/core/server/data/migrations/versions/5.65/2023-09-22-06-42-55-repopulate-built-in-featured-collection-posts.js | const logging = require('@tryghost/logging');
const {default: ObjectID} = require('bson-objectid');
const {createTransactionalMigration} = require('../../utils');
const insertPostCollections = async (knex, collectionId, postIds) => {
logging.warn(`Batch inserting ${postIds.length} collection posts for collection $... | javascript | MIT | 31ecb69a147e71743e74014b4e04ccce09ab8c1a | 2026-01-04T14:57:14.657301Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.