From 989f29f11aaf5d30f2d831e9ff244ff6936ab3c1 Mon Sep 17 00:00:00 2001 From: Alexandre Bodin Date: Wed, 29 Sep 2021 17:31:01 +0200 Subject: [PATCH] Fix migration d&p --- packages/core/strapi/lib/migrations/draft-publish.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/strapi/lib/migrations/draft-publish.js b/packages/core/strapi/lib/migrations/draft-publish.js index 668e872343..c80e09e15c 100644 --- a/packages/core/strapi/lib/migrations/draft-publish.js +++ b/packages/core/strapi/lib/migrations/draft-publish.js @@ -20,8 +20,8 @@ const enableDraftAndPublish = async ({ oldContentTypes, contentTypes }) => { if (!hasDraftAndPublish(oldContentType) && hasDraftAndPublish(contentType)) { const qb = strapi.db.queryBuilder(uid); await qb - .update({ publishedAt: qb.ref('createdAt') }) - .where({ publishedAt: null }) + .update({ published_at: qb.ref('created_at') }) + .where({ published_at: null }) .execute(); } } @@ -45,7 +45,7 @@ const disableDraftAndPublish = async ({ oldContentTypes, contentTypes }) => { await strapi.db .queryBuilder(uid) .delete() - .where({ publishedAt: null }) + .where({ published_at: null }) .execute(); } }