@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
2 lines • 1.27 kB
JavaScript
import e from"../logger.mjs";const t=e=>{let t=e.columnName?`${e.tableName}.${e.columnName}`:e.indexName?`${e.tableName}.${e.indexName}`:e.tableName;return{create_table:`create table ${t}`,remove_table:`drop table ${t}`,add_nullable_column:`add nullable column ${t}`,add_constrained_column:`add required or constrained column ${t}`,change_column_default:`change default for ${t}`,relax_column_nullability:`make ${t} nullable`,tighten_column_nullability:`make ${t} required`,modify_column_type:`change the type of ${t}`,modify_column_constraint:`change a unique or foreign-key constraint on ${t}`,recreate_column:`drop and recreate column ${t}`,remove_column:`drop column ${t}`,add_index:`add index ${t}`,add_unique_index:`add unique index ${t}`,remove_index:`remove index ${t}`,remove_unique_index:`remove unique index ${t}`}[e.code]},n=n=>{for(let r of[`safe`,`warning`,`destructive`]){let i=n.reasons.filter(e=>e.risk===r);if(i.length===0)continue;let a=`${r[0]?.toUpperCase()}${r.slice(1)} collection changes:`;r===`safe`?e.info(a):r===`warning`?e.warn(a):e.error(a);for(let n of i)e.log(`${n.collectionKey}: ${t(n)}`,{indent:2,symbol:`child`})}};export{t as describeMigrationRiskReason,n as reportMigrationAssessment};
//# sourceMappingURL=migration-report.mjs.map