20 lines
504 B
JavaScript
20 lines
504 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* 在应用启动阶段触发订单发货表的 managed table schema 自检。
|
|
* @param {import('egg').Application} app 应用实例。
|
|
* @return {Promise<void>}
|
|
*/
|
|
module.exports = async app => {
|
|
if (!app || !app.OrderDeliveryFactory) {
|
|
return;
|
|
}
|
|
|
|
if (typeof app.OrderDeliveryFactory.ensureManagedTableSchemas !== 'function') {
|
|
return;
|
|
}
|
|
|
|
await app.OrderDeliveryFactory.ensureManagedTableSchemas();
|
|
app.logger.info('✅ 订单工厂目标表自检完成');
|
|
};
|