fix(cms): add logs to onInit to diagnose migration issue
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 2m14s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 2m14s
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
This commit is contained in:
@@ -28,10 +28,14 @@ const dirname = path.dirname(filename);
|
|||||||
|
|
||||||
export default buildConfig({
|
export default buildConfig({
|
||||||
onInit: async (payload) => {
|
onInit: async (payload) => {
|
||||||
|
payload.logger.info('Payload onInit hook started');
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
payload.logger.info('Running automated migrations...');
|
||||||
await payload.db.migrate();
|
await payload.db.migrate();
|
||||||
|
payload.logger.info('Seeding database...');
|
||||||
await seedDatabase(payload);
|
await seedDatabase(payload);
|
||||||
}
|
}
|
||||||
|
payload.logger.info('Payload onInit hook finished');
|
||||||
},
|
},
|
||||||
admin: {
|
admin: {
|
||||||
user: Users.slug,
|
user: Users.slug,
|
||||||
|
|||||||
Reference in New Issue
Block a user