UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 566 B
import e from"./schema/infer-schema.mjs";import t from"./migration/generate-migration-plan.mjs";const n=async n=>{let r=await n.config.db.inferSchema(n.db.client),i=[];for(let a of n.config.collections){let o=e(a,n.config.db);if(o.error)return o;let s=new Set(o.data.tables.map(e=>e.name)),c=t({schemas:{existing:r.filter(e=>s.has(e.name)),current:o.data},db:n.config.db});if(c.error)return c;i.push({migrationPlan:c.data,inferredSchema:o.data})}return{data:{collections:i},error:void 0}};export{n as default}; //# sourceMappingURL=plan-collection-migrations.mjs.map