対応バージョン ghost-5.116.2-next Branch
- Foreign keyの制約を削除する (DB新規作成するとき、Postsがいつも2番目作成され、social_groupsが前に作成できない)
/home/aidabo/work/legacy/00-Ghost-5.116.2/ghost/core/core/server/data/migrations/versions/5.115/2025-04-01-18-00-00-add-social-group-column-to-post.js
const {createAddColumnMigration} = require('../../utils');
module.exports = createAddColumnMigration('posts', 'group_id', {
type: 'string',
maxlength: 24,
nullable: true
// references: 'social_groups.id',
// add : true
});
- 同様にSchema.jsも変更する。
/home/aidabo/work/legacy/00-Ghost-5.116.2/ghost/core/core/server/data/schema/schema.js
/*group_id: {type: 'string', maxlength: 24, nullable: true, references: 'social_groups.id', cascadeDelete: true},*/
group_id: {type: 'string', maxlength: 24, nullable: true},